<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: datatable   DataTable.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>DataTable Widget&nbsp; <span class="subtitle">2.9.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_datatable.html" title="datatable">datatable</a>
                
                 &gt; DataTable.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
                        <div class="highlight"><pre><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>

<span class="kd">var</span> <span class="nx">lang</span>   <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">,</span>
    <span class="nx">util</span>   <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">,</span>
    <span class="nx">widget</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">,</span>
    <span class="nx">ua</span>     <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">env</span><span class="p">.</span><span class="nx">ua</span><span class="p">,</span>
    
    <span class="nx">Dom</span>    <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Dom</span><span class="p">,</span>
    <span class="nx">Ev</span>     <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">,</span>
    <span class="nx">DS</span>     <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">DataSourceBase</span><span class="p">;</span>

<span class="cm">/**</span>
<span class="cm"> * The DataTable widget provides a progressively enhanced DHTML control for</span>
<span class="cm"> * displaying tabular data across A-grade browsers.</span>
<span class="cm"> *</span>
<span class="cm"> * @module datatable</span>
<span class="cm"> * @requires yahoo, dom, event, element, datasource</span>
<span class="cm"> * @optional dragdrop, dragdrop</span>
<span class="cm"> * @title DataTable Widget</span>
<span class="cm"> */</span>

<span class="cm">/****************************************************************************/</span>
<span class="cm">/****************************************************************************/</span>
<span class="cm">/****************************************************************************/</span>

<span class="cm">/**</span>
<span class="cm"> * DataTable class for the YUI DataTable widget.</span>
<span class="cm"> *</span>
<span class="cm"> * @namespace YAHOO.widget</span>
<span class="cm"> * @class DataTable</span>
<span class="cm"> * @extends YAHOO.util.Element</span>
<span class="cm"> * @constructor</span>
<span class="cm"> * @param elContainer {HTMLElement} Container element for the TABLE.</span>
<span class="cm"> * @param aColumnDefs {Object[]} Array of object literal Column definitions.</span>
<span class="cm"> * @param oDataSource {YAHOO.util.DataSource} DataSource instance.</span>
<span class="cm"> * @param oConfigs {object} (optional) Object literal of configuration values.</span>
<span class="cm"> */</span>
<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">DataTable</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span><span class="nx">aColumnDefs</span><span class="p">,</span><span class="nx">oDataSource</span><span class="p">,</span><span class="nx">oConfigs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">DT</span> <span class="o">=</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">DataTable</span><span class="p">;</span>
    
    <span class="c1">////////////////////////////////////////////////////////////////////////////</span>
    <span class="c1">// Backward compatibility for SDT, but prevent infinite loops</span>
    
    <span class="k">if</span><span class="p">(</span><span class="nx">oConfigs</span> <span class="o">&amp;&amp;</span> <span class="nx">oConfigs</span><span class="p">.</span><span class="nx">scrollable</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">ScrollingDataTable</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span><span class="nx">aColumnDefs</span><span class="p">,</span><span class="nx">oDataSource</span><span class="p">,</span><span class="nx">oConfigs</span><span class="p">);</span>
    <span class="p">}</span>
    
    <span class="c1">////////////////////////////////////////////////////////////////////////////</span>
    <span class="c1">// Initialization</span>

    <span class="c1">// Internal vars</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_nIndex</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">_nCount</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">generateId</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s2">&quot;yui-dt&quot;</span><span class="p">);</span><span class="c1">// &quot;yui-dt&quot;+this._nIndex;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Chain</span><span class="p">();</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;end&quot;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_onRenderChainEnd</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

    <span class="c1">// Initialize configs</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initConfigs</span><span class="p">(</span><span class="nx">oConfigs</span><span class="p">);</span>

    <span class="c1">// Initialize DataSource</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initDataSource</span><span class="p">(</span><span class="nx">oDataSource</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not instantiate DataTable due to an invalid DataSource&quot;</span><span class="p">,</span> <span class="s2">&quot;error&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="c1">// Initialize ColumnSet</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnSet</span><span class="p">(</span><span class="nx">aColumnDefs</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not instantiate DataTable due to an invalid ColumnSet&quot;</span><span class="p">,</span> <span class="s2">&quot;error&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="c1">// Initialize RecordSet</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initRecordSet</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">)</span> <span class="p">{</span>
    <span class="p">}</span>

    <span class="c1">// Initialize Attributes</span>
    <span class="nx">DT</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">constructor</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">elContainer</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">configs</span><span class="p">);</span>

    <span class="c1">// Initialize DOM elements</span>
    <span class="kd">var</span> <span class="nx">okDom</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_initDomElements</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">okDom</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not instantiate DataTable due to an invalid DOM element&quot;</span><span class="p">,</span> <span class="s2">&quot;error&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
            
    <span class="c1">// Show message as soon as config is available</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_LOADING&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LOADING</span><span class="p">);</span>
    
    <span class="c1">////////////////////////////////////////////////////////////////////////////</span>
    <span class="c1">// Once per instance</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initEvents</span><span class="p">();</span>

    <span class="nx">DT</span><span class="p">.</span><span class="nx">_nCount</span><span class="o">++</span><span class="p">;</span>
    <span class="nx">DT</span><span class="p">.</span><span class="nx">_nCurrentCount</span><span class="o">++</span><span class="p">;</span>
    
    <span class="c1">////////////////////////////////////////////////////////////////////////////</span>
    <span class="c1">// Data integration</span>

    <span class="c1">// Send a simple initial request</span>
    <span class="kd">var</span> <span class="nx">oCallback</span> <span class="o">=</span> <span class="p">{</span>
        <span class="nx">success</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">,</span>
        <span class="nx">failure</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">,</span>
        <span class="nx">scope</span>   <span class="o">:</span> <span class="k">this</span><span class="p">,</span>
        <span class="nx">argument</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getState</span><span class="p">()</span>
    <span class="p">};</span>
    
    <span class="kd">var</span> <span class="nx">initialLoad</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;initialLoad&quot;</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">initialLoad</span> <span class="o">===</span> <span class="kc">true</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">.</span><span class="nx">sendRequest</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;initialRequest&quot;</span><span class="p">),</span> <span class="nx">oCallback</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="c1">// Do not send an initial request at all</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">initialLoad</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_EMPTY&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_EMPTY</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="c1">// Send an initial request with a custom payload</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oCustom</span> <span class="o">=</span> <span class="nx">initialLoad</span> <span class="o">||</span> <span class="p">{};</span>
        <span class="nx">oCallback</span><span class="p">.</span><span class="nx">argument</span> <span class="o">=</span> <span class="nx">oCustom</span><span class="p">.</span><span class="nx">argument</span> <span class="o">||</span> <span class="p">{};</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">.</span><span class="nx">sendRequest</span><span class="p">(</span><span class="nx">oCustom</span><span class="p">.</span><span class="nx">request</span><span class="p">,</span> <span class="nx">oCallback</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">};</span>

<span class="kd">var</span> <span class="nx">DT</span> <span class="o">=</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">DataTable</span><span class="p">;</span>

<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Public constants</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

<span class="nx">lang</span><span class="p">.</span><span class="nx">augmentObject</span><span class="p">(</span><span class="nx">DT</span><span class="p">,</span> <span class="p">{</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to outer DataTable container.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_DATATABLE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_DATATABLE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to liner DIV elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_LINER</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-liner&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_LINER</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-liner&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to display label elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_LABEL</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-label&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_LABEL</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-label&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to messaging elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_MESSAGE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-message&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_MESSAGE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-message&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to mask element when DataTable is disabled.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_MASK</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-mask&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_MASK</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-mask&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to data elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_DATA</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-data&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_DATA</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-data&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to Column drag target.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_COLTARGET</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-coltarget&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_COLTARGET</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-coltarget&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to resizer handle elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_RESIZER</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-resizer&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_RESIZER</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-resizer&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to resizer liner elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_RESIZERLINER</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-resizerliner&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_RESIZERLINER</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-resizerliner&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to resizer proxy elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_RESIZERPROXY</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-resizerproxy&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_RESIZERPROXY</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-resizerproxy&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to CellEditor container elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_EDITOR</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-editor&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_EDITOR</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-editor&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to CellEditor container shim.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_EDITOR_SHIM</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-editor-shim&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_EDITOR_SHIM</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-editor-shim&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to paginator container elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_PAGINATOR</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-paginator&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_PAGINATOR</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-paginator&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to page number indicators.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_PAGE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-page&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_PAGE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-page&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to default indicators.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_DEFAULT</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-default&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_DEFAULT</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-default&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to previous indicators.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_PREVIOUS</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-previous&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_PREVIOUS</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-previous&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned next indicators.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_NEXT</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-next&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_NEXT</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-next&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to first elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_FIRST</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-first&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_FIRST</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-first&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to last elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_LAST</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-last&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_LAST</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-last&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to Record elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_REC</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-rec&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_REC</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-rec&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to even elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_EVEN</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-even&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_EVEN</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-even&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to odd elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_ODD</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-odd&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_ODD</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-odd&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to selected elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_SELECTED</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-selected&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_SELECTED</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-selected&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to highlighted elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_HIGHLIGHTED</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-highlighted&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_HIGHLIGHTED</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-highlighted&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to hidden elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_HIDDEN</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-hidden&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_HIDDEN</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-hidden&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to disabled elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_DISABLED</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-disabled&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_DISABLED</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-disabled&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to empty indicators.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_EMPTY</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-empty&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_EMPTY</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-empty&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to loading indicatorx.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_LOADING</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-loading&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_LOADING</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-loading&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to error indicators.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_ERROR</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-error&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_ERROR</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-error&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to editable elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_EDITABLE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-editable&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_EDITABLE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-editable&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to draggable elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_DRAGGABLE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-draggable&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_DRAGGABLE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-draggable&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to resizeable elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_RESIZEABLE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-resizeable&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_RESIZEABLE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-resizeable&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to scrollable elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_SCROLLABLE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-scrollable&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_SCROLLABLE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-scrollable&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to sortable elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_SORTABLE</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-sortable&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_SORTABLE</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-sortable&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to ascending elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_ASC</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-asc&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_ASC</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-asc&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to descending elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_DESC</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-desc&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_DESC</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-desc&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to BUTTON elements and/or container elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_BUTTON</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-button&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_BUTTON</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-button&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to INPUT TYPE=CHECKBOX elements and/or container elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_CHECKBOX</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-checkbox&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_CHECKBOX</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-checkbox&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to SELECT elements and/or container elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_DROPDOWN</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-dropdown&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_DROPDOWN</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-dropdown&quot;</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Class name assigned to INPUT TYPE=RADIO elements and/or container elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable.CLASS_RADIO</span>
<span class="cm">     * @type String</span>
<span class="cm">     * @static</span>
<span class="cm">     * @final</span>
<span class="cm">     * @default &quot;yui-dt-radio&quot;</span>
<span class="cm">     */</span>
    <span class="nx">CLASS_RADIO</span> <span class="o">:</span> <span class="s2">&quot;yui-dt-radio&quot;</span><span class="p">,</span>

    <span class="c1">/////////////////////////////////////////////////////////////////////////</span>
    <span class="c1">//</span>
    <span class="c1">// Private static properties</span>
    <span class="c1">//</span>
    <span class="c1">/////////////////////////////////////////////////////////////////////////</span>

    <span class="cm">/**</span>
<span class="cm">     * Internal class variable for indexing multiple DataTable instances.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable._nCount</span>
<span class="cm">     * @type Number</span>
<span class="cm">     * @private</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">_nCount</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Internal class variable tracking current number of DataTable instances,</span>
<span class="cm">     * so that certain class values can be reset when all instances are destroyed.          </span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable._nCurrentCount</span>
<span class="cm">     * @type Number</span>
<span class="cm">     * @private</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">_nCurrentCount</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Reference to the STYLE node that is dynamically created and updated</span>
<span class="cm">     * in order to manage Column widths.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable._elDynStyleNode</span>
<span class="cm">     * @type HTMLElement</span>
<span class="cm">     * @private</span>
<span class="cm">     * @static     </span>
<span class="cm">     */</span>
    <span class="nx">_elDynStyleNode</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Set to true if _elDynStyleNode cannot be populated due to browser incompatibility.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable._bDynStylesFallback</span>
<span class="cm">     * @type boolean</span>
<span class="cm">     * @private</span>
<span class="cm">     * @static     </span>
<span class="cm">     */</span>
    <span class="nx">_bDynStylesFallback</span> <span class="o">:</span> <span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="o">?</span> <span class="kc">true</span> <span class="o">:</span> <span class="kc">false</span><span class="p">,</span>

    <span class="cm">/**</span>
<span class="cm">     * Object literal hash of Columns and their dynamically create style rules.</span>
<span class="cm">     *</span>
<span class="cm">     * @property DataTable._oDynStyles</span>
<span class="cm">     * @type Object</span>
<span class="cm">     * @private</span>
<span class="cm">     * @static     </span>
<span class="cm">     */</span>
    <span class="nx">_oDynStyles</span> <span class="o">:</span> <span class="p">{},</span>

    <span class="c1">/////////////////////////////////////////////////////////////////////////</span>
    <span class="c1">//</span>
    <span class="c1">// Private static methods</span>
    <span class="c1">//</span>
    <span class="c1">/////////////////////////////////////////////////////////////////////////</span>

    <span class="cm">/**</span>
<span class="cm">     * Clones object literal or array of object literals.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable._cloneObject</span>
<span class="cm">     * @param o {Object} Object.</span>
<span class="cm">     * @private</span>
<span class="cm">     * @static     </span>
<span class="cm">     */</span>
    <span class="nx">_cloneObject</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">o</span><span class="p">))</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">o</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="kd">var</span> <span class="nx">copy</span> <span class="o">=</span> <span class="p">{};</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">o</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">BaseCellEditor</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">copy</span> <span class="o">=</span> <span class="nx">o</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nb">Object</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">toString</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="o">===</span> <span class="s2">&quot;[object RegExp]&quot;</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">copy</span> <span class="o">=</span> <span class="nx">o</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span><span class="p">(</span><span class="nx">o</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">copy</span> <span class="o">=</span> <span class="nx">o</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">o</span><span class="p">))</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">array</span> <span class="o">=</span> <span class="p">[];</span>
            <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span><span class="nx">len</span><span class="o">=</span><span class="nx">o</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span><span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span><span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">array</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">_cloneObject</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
            <span class="p">}</span>
            <span class="nx">copy</span> <span class="o">=</span> <span class="nx">array</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">o</span><span class="p">))</span> <span class="p">{</span>
            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">x</span> <span class="k">in</span> <span class="nx">o</span><span class="p">){</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">x</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">x</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">x</span><span class="p">])</span> <span class="o">||</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">x</span><span class="p">]))</span> <span class="p">{</span>
                        <span class="nx">copy</span><span class="p">[</span><span class="nx">x</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">_cloneObject</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">x</span><span class="p">]);</span>
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">copy</span><span class="p">[</span><span class="nx">x</span><span class="p">]</span> <span class="o">=</span> <span class="nx">o</span><span class="p">[</span><span class="nx">x</span><span class="p">];</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">copy</span> <span class="o">=</span> <span class="nx">o</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="k">return</span> <span class="nx">copy</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats a BUTTON element.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatButton</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {HTML} Data value for the cell. By default, the value</span>
<span class="cm">     * is what gets written to the BUTTON. String values are treated as markup</span>
<span class="cm">     * and inserted into the DOM with innerHTML.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatButton</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">sValue</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oData</span> <span class="o">:</span> <span class="s2">&quot;Click&quot;</span><span class="p">;</span>
        <span class="c1">//TODO: support YAHOO.widget.Button</span>
        <span class="c1">//if(YAHOO.widget.Button) {</span>

        <span class="c1">//}</span>
        <span class="c1">//else {</span>
            <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;button type=\&quot;button\&quot; class=\&quot;&quot;</span><span class="o">+</span>
                    <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_BUTTON</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&gt;&quot;</span> <span class="o">+</span> <span class="nx">sValue</span> <span class="o">+</span> <span class="s2">&quot;&lt;/button&gt;&quot;</span><span class="p">;</span>
        <span class="c1">//}</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats a CHECKBOX element.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatCheckbox</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Object | Boolean | HTML} Data value for the cell. Can be a simple</span>
<span class="cm">     * Boolean to indicate whether checkbox is checked or not. Can be object literal</span>
<span class="cm">     * {checked:bBoolean, label:sLabel}. String values are treated as markup</span>
<span class="cm">     * and inserted into the DOM with innerHTML.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatCheckbox</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">bChecked</span> <span class="o">=</span> <span class="nx">oData</span><span class="p">;</span>
        <span class="nx">bChecked</span> <span class="o">=</span> <span class="p">(</span><span class="nx">bChecked</span><span class="p">)</span> <span class="o">?</span> <span class="s2">&quot; checked=\&quot;checked\&quot;&quot;</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;input type=\&quot;checkbox\&quot;&quot;</span> <span class="o">+</span> <span class="nx">bChecked</span> <span class="o">+</span>
                <span class="s2">&quot; class=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_CHECKBOX</span> <span class="o">+</span> <span class="s2">&quot;\&quot; /&gt;&quot;</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats currency. Default unit is USD.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatCurrency</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Number} Data value for the cell.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatCurrency</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oDT</span> <span class="o">=</span> <span class="nx">oDataTable</span> <span class="o">||</span> <span class="k">this</span><span class="p">;</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nb">Number</span><span class="p">.</span><span class="nx">format</span><span class="p">(</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">currencyOptions</span> <span class="o">||</span> <span class="nx">oDT</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;currencyOptions&quot;</span><span class="p">));</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats JavaScript Dates.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatDate</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Object} Data value for the cell, or null. String values are</span>
<span class="cm">     * treated as markup and inserted into the DOM with innerHTML.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatDate</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oDT</span> <span class="o">=</span> <span class="nx">oDataTable</span> <span class="o">||</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">oConfig</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">dateOptions</span> <span class="o">||</span> <span class="nx">oDT</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;dateOptions&quot;</span><span class="p">);</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nb">Date</span><span class="p">.</span><span class="nx">format</span><span class="p">(</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">,</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">locale</span><span class="p">);</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats SELECT elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatDropdown</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Object} Data value for the cell, or null. String values may</span>
<span class="cm">     * be treated as markup and inserted into the DOM with innerHTML as element</span>
<span class="cm">     * label.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatDropdown</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oDT</span> <span class="o">=</span> <span class="nx">oDataTable</span> <span class="o">||</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">selectedValue</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">))</span> <span class="o">?</span> <span class="nx">oData</span> <span class="o">:</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getData</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">field</span><span class="p">),</span>
            <span class="nx">options</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">dropdownOptions</span><span class="p">))</span> <span class="o">?</span>
                <span class="nx">oColumn</span><span class="p">.</span><span class="nx">dropdownOptions</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

            <span class="nx">selectEl</span><span class="p">,</span>
            <span class="nx">collection</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s2">&quot;select&quot;</span><span class="p">);</span>

        <span class="c1">// Create the form element only once, so we can attach the onChange listener</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">collection</span><span class="p">.</span><span class="nx">length</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Create SELECT element</span>
            <span class="nx">selectEl</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;select&quot;</span><span class="p">);</span>
            <span class="nx">selectEl</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DROPDOWN</span><span class="p">;</span>
            <span class="nx">selectEl</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">selectEl</span><span class="p">);</span>

            <span class="c1">// Add event listener</span>
            <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">selectEl</span><span class="p">,</span><span class="s2">&quot;change&quot;</span><span class="p">,</span><span class="nx">oDT</span><span class="p">.</span><span class="nx">_onDropdownChange</span><span class="p">,</span><span class="nx">oDT</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="nx">selectEl</span> <span class="o">=</span> <span class="nx">collection</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>

        <span class="c1">// Update the form element</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">selectEl</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Clear out previous options</span>
            <span class="nx">selectEl</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>

            <span class="c1">// We have options to populate</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">options</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Create OPTION elements</span>
                <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">options</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">option</span> <span class="o">=</span> <span class="nx">options</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="kd">var</span> <span class="nx">optionEl</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;option&quot;</span><span class="p">);</span>
                    <span class="nx">optionEl</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">option</span><span class="p">.</span><span class="nx">value</span><span class="p">))</span> <span class="o">?</span>
                            <span class="nx">option</span><span class="p">.</span><span class="nx">value</span> <span class="o">:</span> <span class="nx">option</span><span class="p">;</span>
                    <span class="c1">// Bug 2334323: Support legacy text, support label for consistency with DropdownCellEditor</span>
                    <span class="nx">optionEl</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">option</span><span class="p">.</span><span class="nx">text</span><span class="p">))</span> <span class="o">?</span>
                            <span class="nx">option</span><span class="p">.</span><span class="nx">text</span> <span class="o">:</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">option</span><span class="p">.</span><span class="nx">label</span><span class="p">))</span> <span class="o">?</span> <span class="nx">option</span><span class="p">.</span><span class="nx">label</span> <span class="o">:</span> <span class="nx">option</span><span class="p">;</span>
                    <span class="nx">optionEl</span> <span class="o">=</span> <span class="nx">selectEl</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">optionEl</span><span class="p">);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">optionEl</span><span class="p">.</span><span class="nx">value</span> <span class="o">==</span> <span class="nx">selectedValue</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">optionEl</span><span class="p">.</span><span class="nx">selected</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Selected value is our only option</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">selectEl</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;option selected value=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">selectedValue</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&gt;&quot;</span> <span class="o">+</span> <span class="nx">selectedValue</span> <span class="o">+</span> <span class="s2">&quot;&lt;/option&gt;&quot;</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oData</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats emails.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatEmail</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {String} Data value for the cell, or null. Values are</span>
<span class="cm">     * HTML-escaped.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatEmail</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">oData</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">oData</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">escapeHTML</span><span class="p">(</span><span class="nx">oData</span><span class="p">);</span>
            <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;a href=\&quot;mailto:&quot;</span> <span class="o">+</span> <span class="nx">oData</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&gt;&quot;</span> <span class="o">+</span> <span class="nx">oData</span> <span class="o">+</span> <span class="s2">&quot;&lt;/a&gt;&quot;</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">?</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">escapeHTML</span><span class="p">(</span><span class="nx">oData</span><span class="p">.</span><span class="nx">toString</span><span class="p">())</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats links.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatLink</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {String} Data value for the cell, or null. Values are</span>
<span class="cm">     * HTML-escaped</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatLink</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">oData</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">oData</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">escapeHTML</span><span class="p">(</span><span class="nx">oData</span><span class="p">);</span>
            <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;a href=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">oData</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&gt;&quot;</span> <span class="o">+</span> <span class="nx">oData</span> <span class="o">+</span> <span class="s2">&quot;&lt;/a&gt;&quot;</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">?</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">escapeHTML</span><span class="p">(</span><span class="nx">oData</span><span class="p">.</span><span class="nx">toString</span><span class="p">())</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats numbers.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatNumber</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Object} Data value for the cell, or null.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatNumber</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oDT</span> <span class="o">=</span> <span class="nx">oDataTable</span> <span class="o">||</span> <span class="k">this</span><span class="p">;</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nb">Number</span><span class="p">.</span><span class="nx">format</span><span class="p">(</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">numberOptions</span> <span class="o">||</span> <span class="nx">oDT</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;numberOptions&quot;</span><span class="p">));</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats INPUT TYPE=RADIO elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatRadio</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Object} (Optional) Data value for the cell.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatRadio</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oDT</span> <span class="o">=</span> <span class="nx">oDataTable</span> <span class="o">||</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">bChecked</span> <span class="o">=</span> <span class="nx">oData</span><span class="p">;</span>
        <span class="nx">bChecked</span> <span class="o">=</span> <span class="p">(</span><span class="nx">bChecked</span><span class="p">)</span> <span class="o">?</span> <span class="s2">&quot; checked=\&quot;checked\&quot;&quot;</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;input type=\&quot;radio\&quot;&quot;</span> <span class="o">+</span> <span class="nx">bChecked</span> <span class="o">+</span>
                <span class="s2">&quot; name=\&quot;&quot;</span><span class="o">+</span><span class="nx">oDT</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span><span class="o">+</span><span class="s2">&quot;-col-&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getSanitizedKey</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&quot;</span> <span class="o">+</span>
                <span class="s2">&quot; class=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_RADIO</span><span class="o">+</span> <span class="s2">&quot;\&quot; /&gt;&quot;</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats text strings.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatText</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {String} (Optional) Data value for the cell. Values are</span>
<span class="cm">     * HTML-escaped.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatText</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">))</span> <span class="o">?</span> <span class="nx">oData</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">escapeHTML</span><span class="p">(</span><span class="nx">value</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats TEXTAREA elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatTextarea</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Object} (Optional) Data value for the cell. Values are</span>
<span class="cm">     * HTML-escaped.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatTextarea</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">))</span> <span class="o">?</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">escapeHTML</span><span class="p">(</span><span class="nx">oData</span><span class="p">.</span><span class="nx">toString</span><span class="p">())</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
            <span class="nx">markup</span> <span class="o">=</span> <span class="s2">&quot;&lt;textarea&gt;&quot;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s2">&quot;&lt;/textarea&gt;&quot;</span><span class="p">;</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">markup</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Formats INPUT TYPE=TEXT elements.</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatTextbox</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {Object} (Optional) Data value for the cell. Values are</span>
<span class="cm">     * HTML-escaped.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatTextbox</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">value</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">))</span> <span class="o">?</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">escapeHTML</span><span class="p">(</span><span class="nx">oData</span><span class="p">.</span><span class="nx">toString</span><span class="p">())</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
            <span class="nx">markup</span> <span class="o">=</span> <span class="s2">&quot;&lt;input type=\&quot;text\&quot; value=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">value</span> <span class="o">+</span> <span class="s2">&quot;\&quot; /&gt;&quot;</span><span class="p">;</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">markup</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Default cell formatter</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.formatDefault</span>
<span class="cm">     * @param el {HTMLElement} The element to format with markup.</span>
<span class="cm">     * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm">     * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm">     * @param oData {HTML} (Optional) Data value for the cell. String values are</span>
<span class="cm">     * treated as markup and inserted into the DOM with innerHTML.</span>
<span class="cm">     * @param oDataTable {YAHOO.widget.DataTable} DataTable instance.</span>
<span class="cm">     * @static</span>
<span class="cm">     */</span>
    <span class="nx">formatDefault</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">oDataTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">oData</span> <span class="o">!==</span> <span class="s2">&quot;&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oData</span><span class="p">.</span><span class="nx">toString</span><span class="p">()</span> <span class="o">:</span> <span class="s2">&quot;&amp;#160;&quot;</span><span class="p">;</span>
    <span class="p">},</span>

    <span class="cm">/**</span>
<span class="cm">     * Validates data value to type Number, doing type conversion as</span>
<span class="cm">     * necessary. A valid Number value is return, else null is returned</span>
<span class="cm">     * if input value does not validate.</span>
<span class="cm">     *</span>
<span class="cm">     *</span>
<span class="cm">     * @method DataTable.validateNumber</span>
<span class="cm">     * @param oData {Object} Data to validate.</span>
<span class="cm">     * @static</span>
<span class="cm">    */</span>
    <span class="nx">validateNumber</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">//Convert to number</span>
        <span class="kd">var</span> <span class="nx">number</span> <span class="o">=</span> <span class="nx">oData</span> <span class="o">*</span> <span class="mi">1</span><span class="p">;</span>

        <span class="c1">// Validate</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">number</span><span class="p">))</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">number</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not validate data &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; to type Number&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
            <span class="k">return</span> <span class="kc">undefined</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">});</span>

<span class="c1">// Done in separate step so referenced functions are defined.</span>
<span class="cm">/**</span>
<span class="cm"> * Registry of cell formatting functions, enables shortcut pointers in Column</span>
<span class="cm"> * definition formatter value (i.e., {key:&quot;myColumn&quot;, formatter:&quot;date&quot;}).</span>
<span class="cm"> * @property DataTable.Formatter</span>
<span class="cm"> * @type Object</span>
<span class="cm"> * @static</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">Formatter</span> <span class="o">=</span> <span class="p">{</span>
    <span class="nx">button</span>   <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatButton</span><span class="p">,</span>
    <span class="nx">checkbox</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatCheckbox</span><span class="p">,</span>
    <span class="nx">currency</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatCurrency</span><span class="p">,</span>
    <span class="s2">&quot;date&quot;</span>   <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatDate</span><span class="p">,</span>
    <span class="nx">dropdown</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatDropdown</span><span class="p">,</span>
    <span class="nx">email</span>    <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatEmail</span><span class="p">,</span>
    <span class="nx">link</span>     <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatLink</span><span class="p">,</span>
    <span class="s2">&quot;number&quot;</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatNumber</span><span class="p">,</span>
    <span class="nx">radio</span>    <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatRadio</span><span class="p">,</span>
    <span class="nx">text</span>     <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatText</span><span class="p">,</span>
    <span class="nx">textarea</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatTextarea</span><span class="p">,</span>
    <span class="nx">textbox</span>  <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatTextbox</span><span class="p">,</span>

    <span class="nx">defaultFormatter</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">formatDefault</span>
<span class="p">};</span>

<span class="nx">lang</span><span class="p">.</span><span class="nx">extend</span><span class="p">(</span><span class="nx">DT</span><span class="p">,</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Element</span><span class="p">,</span> <span class="p">{</span>

<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Superclass methods</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

<span class="cm">/**</span>
<span class="cm"> * Implementation of Element&#39;s abstract method. Sets up config values.</span>
<span class="cm"> *</span>
<span class="cm"> * @method initAttributes</span>
<span class="cm"> * @param oConfigs {Object} (Optional) Object literal definition of configuration values.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>

<span class="nx">initAttributes</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oConfigs</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oConfigs</span> <span class="o">=</span> <span class="nx">oConfigs</span> <span class="o">||</span> <span class="p">{};</span>
    <span class="nx">DT</span><span class="p">.</span><span class="nx">superclass</span><span class="p">.</span><span class="nx">initAttributes</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oConfigs</span><span class="p">);</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute summary</span>
<span class="cm">    * @description String value for the SUMMARY attribute.</span>
<span class="cm">    * @type String</span>
<span class="cm">    * @default &quot;&quot;    </span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;summary&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sSummary</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">.</span><span class="nx">summary</span> <span class="o">=</span> <span class="nx">sSummary</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute selectionMode</span>
<span class="cm">    * @description Specifies row or cell selection mode. Accepts the following strings:</span>
<span class="cm">    *    &lt;dl&gt;</span>
<span class="cm">    *      &lt;dt&gt;&quot;standard&quot;&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Standard row selection with support for modifier keys to enable</span>
<span class="cm">    *      multiple selections.&lt;/dd&gt;</span>
<span class="cm">    *</span>
<span class="cm">    *      &lt;dt&gt;&quot;single&quot;&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Row selection with modifier keys disabled to not allow</span>
<span class="cm">    *      multiple selections.&lt;/dd&gt;</span>
<span class="cm">    *</span>
<span class="cm">    *      &lt;dt&gt;&quot;singlecell&quot;&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Cell selection with modifier keys disabled to not allow</span>
<span class="cm">    *      multiple selections.&lt;/dd&gt;</span>
<span class="cm">    *</span>
<span class="cm">    *      &lt;dt&gt;&quot;cellblock&quot;&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Cell selection with support for modifier keys to enable multiple</span>
<span class="cm">    *      selections in a block-fashion, like a spreadsheet.&lt;/dd&gt;</span>
<span class="cm">    *</span>
<span class="cm">    *      &lt;dt&gt;&quot;cellrange&quot;&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Cell selection with support for modifier keys to enable multiple</span>
<span class="cm">    *      selections in a range-fashion, like a calendar.&lt;/dd&gt;</span>
<span class="cm">    *    &lt;/dl&gt;</span>
<span class="cm">    *</span>
<span class="cm">    * @default &quot;standard&quot;</span>
<span class="cm">    * @type String</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;selectionMode&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;standard&quot;</span><span class="p">,</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute sortedBy</span>
<span class="cm">    * @description Object literal provides metadata for initial sort values if</span>
<span class="cm">    * data will arrive pre-sorted:</span>
<span class="cm">    * &lt;dl&gt;</span>
<span class="cm">    *     &lt;dt&gt;sortedBy.key&lt;/dt&gt;</span>
<span class="cm">    *     &lt;dd&gt;{String} Key of sorted Column&lt;/dd&gt;</span>
<span class="cm">    *     &lt;dt&gt;sortedBy.dir&lt;/dt&gt;</span>
<span class="cm">    *     &lt;dd&gt;{String} Initial sort direction, either YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC&lt;/dd&gt;</span>
<span class="cm">    * &lt;/dl&gt;</span>
<span class="cm">    * @type Object | null</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="c1">// TODO: accepted array for nested sorts</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">key</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">return</span> <span class="p">(</span><span class="nx">oNewSortedBy</span> <span class="o">===</span> <span class="kc">null</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">},</span>
        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Stash the previous value</span>
            <span class="kd">var</span> <span class="nx">oOldSortedBy</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">);</span>
            
            <span class="c1">// Workaround for bug 1827195</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">oNewSortedBy</span><span class="p">;</span>

            <span class="c1">// Remove ASC/DESC from TH</span>
            <span class="kd">var</span> <span class="nx">oOldColumn</span><span class="p">,</span>
                <span class="nx">nOldColumnKeyIndex</span><span class="p">,</span>
                <span class="nx">oNewColumn</span><span class="p">,</span>
                <span class="nx">nNewColumnKeyIndex</span><span class="p">;</span>
                
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oOldSortedBy</span> <span class="o">&amp;&amp;</span> <span class="nx">oOldSortedBy</span><span class="p">.</span><span class="nx">key</span> <span class="o">&amp;&amp;</span> <span class="nx">oOldSortedBy</span><span class="p">.</span><span class="nx">dir</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oOldColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oOldSortedBy</span><span class="p">.</span><span class="nx">key</span><span class="p">);</span>
                    <span class="nx">nOldColumnKeyIndex</span> <span class="o">=</span> <span class="nx">oOldColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
                    
                    <span class="c1">// Remove previous UI from THEAD</span>
                    <span class="kd">var</span> <span class="nx">elOldTh</span> <span class="o">=</span> <span class="nx">oOldColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elOldTh</span><span class="p">,</span> <span class="nx">oOldSortedBy</span><span class="p">.</span><span class="nx">dir</span><span class="p">);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">formatTheadCell</span><span class="p">(</span><span class="nx">oOldColumn</span><span class="p">.</span><span class="nx">getThLinerEl</span><span class="p">().</span><span class="nx">firstChild</span><span class="p">,</span> <span class="nx">oOldColumn</span><span class="p">,</span> <span class="nx">oNewSortedBy</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oNewColumn</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">column</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">column</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">key</span><span class="p">);</span>
                    <span class="nx">nNewColumnKeyIndex</span> <span class="o">=</span> <span class="nx">oNewColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
    
                    <span class="c1">// Update THEAD with new UI</span>
                    <span class="kd">var</span> <span class="nx">elNewTh</span> <span class="o">=</span> <span class="nx">oNewColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">==</span> <span class="s2">&quot;asc&quot;</span><span class="p">)</span> <span class="o">||</span>  <span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">==</span> <span class="s2">&quot;desc&quot;</span><span class="p">)))</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">newClass</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">==</span> <span class="s2">&quot;desc&quot;</span><span class="p">)</span> <span class="o">?</span>
                                <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span> <span class="o">:</span>
                                <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">;</span>
                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elNewTh</span><span class="p">,</span> <span class="nx">newClass</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="p">{</span>
                         <span class="kd">var</span> <span class="nx">sortClass</span> <span class="o">=</span> <span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">||</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">;</span>
                         <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elNewTh</span><span class="p">,</span> <span class="nx">sortClass</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">formatTheadCell</span><span class="p">(</span><span class="nx">oNewColumn</span><span class="p">.</span><span class="nx">getThLinerEl</span><span class="p">().</span><span class="nx">firstChild</span><span class="p">,</span> <span class="nx">oNewColumn</span><span class="p">,</span> <span class="nx">oNewSortedBy</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
          
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Update TBODY UI</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
                <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">,</span>
                    <span class="nx">allCells</span><span class="p">;</span>
                <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">allCells</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">childNodes</span><span class="p">;</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">allCells</span><span class="p">[</span><span class="nx">nOldColumnKeyIndex</span><span class="p">])</span> <span class="p">{</span>
                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">allCells</span><span class="p">[</span><span class="nx">nOldColumnKeyIndex</span><span class="p">],</span> <span class="nx">oOldSortedBy</span><span class="p">.</span><span class="nx">dir</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">allCells</span><span class="p">[</span><span class="nx">nNewColumnKeyIndex</span><span class="p">])</span> <span class="p">{</span>
                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">allCells</span><span class="p">[</span><span class="nx">nNewColumnKeyIndex</span><span class="p">],</span> <span class="nx">oNewSortedBy</span><span class="p">.</span><span class="nx">dir</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
            <span class="p">}</span>
                
            <span class="k">this</span><span class="p">.</span><span class="nx">_clearTrTemplateEl</span><span class="p">();</span>
        <span class="p">}</span>
    <span class="p">});</span>
    
    <span class="cm">/**</span>
<span class="cm">    * @attribute paginator</span>
<span class="cm">    * @description An instance of YAHOO.widget.Paginator.</span>
<span class="cm">    * @default null</span>
<span class="cm">    * @type {Object|YAHOO.widget.Paginator}</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;paginator&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="nx">validator</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">val</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">val</span> <span class="o">===</span> <span class="kc">null</span> <span class="o">||</span> <span class="nx">val</span> <span class="k">instanceof</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Paginator</span><span class="p">;</span>
        <span class="p">},</span>
        <span class="nx">method</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span> <span class="k">this</span><span class="p">.</span><span class="nx">_updatePaginator</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span><span class="nx">arguments</span><span class="p">);</span> <span class="p">}</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute caption</span>
<span class="cm">    * @description Value for the CAPTION element. String values are treated as</span>
<span class="cm">    * markup and inserted into the DOM with innerHTML. NB: Not supported in</span>
<span class="cm">    * ScrollingDataTable.    </span>
<span class="cm">    * @type HTML</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;caption&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sCaption</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_initCaptionEl</span><span class="p">(</span><span class="nx">sCaption</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute draggableColumns</span>
<span class="cm">    * @description True if Columns are draggable to reorder, false otherwise.</span>
<span class="cm">    * The Drag &amp; Drop Utility is required to enable this feature. Only top-level</span>
<span class="cm">    * and non-nested Columns are draggable. Write once.</span>
<span class="cm">    * @default false</span>
<span class="cm">    * @type Boolean</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;draggableColumns&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isBoolean</span><span class="p">,</span>
        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oParam</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oParam</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_initDraggableColumns</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyDraggableColumns</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute renderLoopSize      </span>
<span class="cm">    * @description A value greater than 0 enables DOM rendering of rows to be</span>
<span class="cm">    * executed from a non-blocking timeout queue and sets how many rows to be</span>
<span class="cm">    * rendered per timeout. Recommended for very large data sets.     </span>
<span class="cm">    * @type Number      </span>
<span class="cm">    * @default 0      </span>
<span class="cm">    */</span>      
     <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">,</span> <span class="p">{</span>
         <span class="nx">value</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
         <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span>
     <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute sortFunction</span>
<span class="cm">    * @description Default Column sort function, receives the following args:</span>
<span class="cm">    *    &lt;dl&gt;</span>
<span class="cm">    *      &lt;dt&gt;a {Object}&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;First sort argument.&lt;/dd&gt;</span>
<span class="cm">    *      &lt;dt&gt;b {Object}&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Second sort argument.&lt;/dd&gt;</span>

<span class="cm">    *      &lt;dt&gt;desc {Boolean}&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;True if sort direction is descending, false if</span>
<span class="cm">    * sort direction is ascending.&lt;/dd&gt;</span>
<span class="cm">    *      &lt;dt&gt;field {String}&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;The field to sort by, from sortOptions.field&lt;/dd&gt;</span>
<span class="cm">    *   &lt;/dl&gt;</span>
<span class="cm">    * @type function</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;sortFunction&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">,</span> <span class="nx">desc</span><span class="p">,</span> <span class="nx">field</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">compare</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Sort</span><span class="p">.</span><span class="nx">compare</span><span class="p">,</span>
                <span class="nx">sorted</span> <span class="o">=</span> <span class="nx">compare</span><span class="p">(</span><span class="nx">a</span><span class="p">.</span><span class="nx">getData</span><span class="p">(</span><span class="nx">field</span><span class="p">),</span><span class="nx">b</span><span class="p">.</span><span class="nx">getData</span><span class="p">(</span><span class="nx">field</span><span class="p">),</span> <span class="nx">desc</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">sorted</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">compare</span><span class="p">(</span><span class="nx">a</span><span class="p">.</span><span class="nx">getCount</span><span class="p">(),</span><span class="nx">b</span><span class="p">.</span><span class="nx">getCount</span><span class="p">(),</span> <span class="nx">desc</span><span class="p">);</span> <span class="c1">// Bug 1932978</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">sorted</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute formatRow</span>
<span class="cm">    * @description A function that accepts a TR element and its associated Record</span>
<span class="cm">    * for custom formatting. The function must return TRUE in order to automatically</span>
<span class="cm">    * continue formatting of child TD elements, else TD elements will not be</span>
<span class="cm">    * automatically formatted.</span>
<span class="cm">    * @type function</span>
<span class="cm">    * @default null</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;formatRow&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute generateRequest</span>
<span class="cm">    * @description A function that converts an object literal of desired DataTable</span>
<span class="cm">    * states into a request value which is then passed to the DataSource&#39;s</span>
<span class="cm">    * sendRequest method in order to retrieve data for those states. This</span>
<span class="cm">    * function is passed an object literal of state data and a reference to the</span>
<span class="cm">    * DataTable instance:</span>
<span class="cm">    *     </span>
<span class="cm">    * &lt;dl&gt;</span>
<span class="cm">    *   &lt;dt&gt;pagination&lt;dt&gt;</span>
<span class="cm">    *   &lt;dd&gt;        </span>
<span class="cm">    *         &lt;dt&gt;offsetRecord&lt;/dt&gt;</span>
<span class="cm">    *         &lt;dd&gt;{Number} Index of the first Record of the desired page&lt;/dd&gt;</span>
<span class="cm">    *         &lt;dt&gt;rowsPerPage&lt;/dt&gt;</span>
<span class="cm">    *         &lt;dd&gt;{Number} Number of rows per page&lt;/dd&gt;</span>
<span class="cm">    *   &lt;/dd&gt;</span>
<span class="cm">    *   &lt;dt&gt;sortedBy&lt;/dt&gt;</span>
<span class="cm">    *   &lt;dd&gt;                </span>
<span class="cm">    *         &lt;dt&gt;key&lt;/dt&gt;</span>
<span class="cm">    *         &lt;dd&gt;{String} Key of sorted Column&lt;/dd&gt;</span>
<span class="cm">    *         &lt;dt&gt;dir&lt;/dt&gt;</span>
<span class="cm">    *         &lt;dd&gt;{String} Sort direction, either YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC&lt;/dd&gt;</span>
<span class="cm">    *   &lt;/dd&gt;</span>
<span class="cm">    *   &lt;dt&gt;self&lt;/dt&gt;</span>
<span class="cm">    *   &lt;dd&gt;The DataTable instance&lt;/dd&gt;</span>
<span class="cm">    * &lt;/dl&gt;</span>
<span class="cm">    * </span>
<span class="cm">    * and by default returns a String of syntax:</span>
<span class="cm">    * &quot;sort={sortColumn}&amp;dir={sortDir}&amp;startIndex={pageStartIndex}&amp;results={rowsPerPage}&quot;</span>
<span class="cm">    * @type function</span>
<span class="cm">    * @default HTMLFunction</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;generateRequest&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oState</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Set defaults</span>
            <span class="nx">oState</span> <span class="o">=</span> <span class="nx">oState</span> <span class="o">||</span> <span class="p">{</span><span class="nx">pagination</span><span class="o">:</span><span class="kc">null</span><span class="p">,</span> <span class="nx">sortedBy</span><span class="o">:</span><span class="kc">null</span><span class="p">};</span>
            <span class="kd">var</span> <span class="nx">sort</span> <span class="o">=</span> <span class="nb">encodeURIComponent</span><span class="p">((</span><span class="nx">oState</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oState</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">.</span><span class="nx">key</span> <span class="o">:</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">getColumnSet</span><span class="p">().</span><span class="nx">keys</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">getKey</span><span class="p">());</span>
            <span class="kd">var</span> <span class="nx">dir</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oState</span><span class="p">.</span><span class="nx">sortedBy</span> <span class="o">&amp;&amp;</span> <span class="nx">oState</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">===</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">DataTable</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">)</span> <span class="o">?</span> <span class="s2">&quot;desc&quot;</span> <span class="o">:</span> <span class="s2">&quot;asc&quot;</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">startIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oState</span><span class="p">.</span><span class="nx">pagination</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oState</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">recordOffset</span> <span class="o">:</span> <span class="mi">0</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">results</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oState</span><span class="p">.</span><span class="nx">pagination</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oState</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">rowsPerPage</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
            
            <span class="c1">// Build the request</span>
            <span class="k">return</span>  <span class="s2">&quot;sort=&quot;</span> <span class="o">+</span> <span class="nx">sort</span> <span class="o">+</span>
                    <span class="s2">&quot;&amp;dir=&quot;</span> <span class="o">+</span> <span class="nx">dir</span> <span class="o">+</span>
                    <span class="s2">&quot;&amp;startIndex=&quot;</span> <span class="o">+</span> <span class="nx">startIndex</span> <span class="o">+</span>
                    <span class="p">((</span><span class="nx">results</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="o">?</span> <span class="s2">&quot;&amp;results=&quot;</span> <span class="o">+</span> <span class="nx">results</span> <span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">);</span>
        <span class="p">},</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute initialRequest</span>
<span class="cm">    * @description Defines the initial request that gets sent to the DataSource</span>
<span class="cm">    * during initialization. Value is ignored if initialLoad is set to any value</span>
<span class="cm">    * other than true.    </span>
<span class="cm">    * @type MIXED</span>
<span class="cm">    * @default null</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;initialRequest&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kc">null</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">    * @attribute initialLoad</span>
<span class="cm">    * @description Determines whether or not to load data at instantiation. By</span>
<span class="cm">    * default, will trigger a sendRequest() to the DataSource and pass in the</span>
<span class="cm">    * request defined by initialRequest. If set to false, data will not load</span>
<span class="cm">    * at instantiation. Alternatively, implementers who wish to work with a </span>
<span class="cm">    * custom payload may pass in an object literal with the following values:</span>
<span class="cm">    *     </span>
<span class="cm">    *    &lt;dl&gt;</span>
<span class="cm">    *      &lt;dt&gt;request (MIXED)&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Request value.&lt;/dd&gt;</span>
<span class="cm">    *</span>
<span class="cm">    *      &lt;dt&gt;argument (MIXED)&lt;/dt&gt;</span>
<span class="cm">    *      &lt;dd&gt;Custom data that will be passed through to the callback function.&lt;/dd&gt;</span>
<span class="cm">    *    &lt;/dl&gt;</span>
<span class="cm">    *</span>
<span class="cm">    *                    </span>
<span class="cm">    * @type Boolean | Object</span>
<span class="cm">    * @default true</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;initialLoad&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kc">true</span>
    <span class="p">});</span>
    
    <span class="cm">/**</span>
<span class="cm">    * @attribute dynamicData</span>
<span class="cm">    * @description If true, sorting and pagination are relegated to the DataSource</span>
<span class="cm">    * for handling, using the request returned by the &quot;generateRequest&quot; function.</span>
<span class="cm">    * Each new DataSource response blows away all previous Records. False by default, so </span>
<span class="cm">    * sorting and pagination will be handled directly on the client side, without</span>
<span class="cm">    * causing any new requests for data from the DataSource.</span>
<span class="cm">    * @type Boolean</span>
<span class="cm">    * @default false</span>
<span class="cm">    */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;dynamicData&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isBoolean</span>
    <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">     * @attribute MSG_EMPTY</span>
<span class="cm">     * @description Message to display if DataTable has no data. String</span>
<span class="cm">     * values are treated as markup and inserted into the DOM with innerHTML.</span>
<span class="cm">     * @type HTML</span>
<span class="cm">     * @default &quot;No records found.&quot;</span>
<span class="cm">     */</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;MSG_EMPTY&quot;</span><span class="p">,</span> <span class="p">{</span>
         <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;No records found.&quot;</span><span class="p">,</span>
         <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span>
     <span class="p">});</span>      

    <span class="cm">/**</span>
<span class="cm">     * @attribute MSG_LOADING</span>
<span class="cm">     * @description Message to display while DataTable is loading data. String</span>
<span class="cm">     * values are treated as markup and inserted into the DOM with innerHTML.</span>
<span class="cm">     * @type HTML</span>
<span class="cm">     * @default &quot;Loading...&quot;</span>
<span class="cm">     */</span>      
     <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;MSG_LOADING&quot;</span><span class="p">,</span> <span class="p">{</span>
         <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;Loading...&quot;</span><span class="p">,</span>
         <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span>
     <span class="p">});</span>      

    <span class="cm">/**</span>
<span class="cm">     * @attribute MSG_ERROR</span>
<span class="cm">     * @description Message to display while DataTable has data error. String</span>
<span class="cm">     * values are treated as markup and inserted into the DOM with innerHTML.</span>
<span class="cm">     * @type HTML</span>
<span class="cm">     * @default &quot;Data error.&quot;</span>
<span class="cm">     */</span>      
     <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;MSG_ERROR&quot;</span><span class="p">,</span> <span class="p">{</span>
         <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;Data error.&quot;</span><span class="p">,</span>
         <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span>
     <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">     * @attribute MSG_SORTASC</span>
<span class="cm">     * @description Message to display in tooltip to sort Column in ascending</span>
<span class="cm">     * order. String values are treated as markup and inserted into the DOM as</span>
<span class="cm">     * innerHTML.</span>
<span class="cm">     * @type HTML</span>
<span class="cm">     * @default &quot;Click to sort ascending&quot;</span>
<span class="cm">     */</span>      
     <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;MSG_SORTASC&quot;</span><span class="p">,</span> <span class="p">{</span>      
         <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;Click to sort ascending&quot;</span><span class="p">,</span>      
         <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
         <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sParam</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">allKeys</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">getColumnSet</span><span class="p">().</span><span class="nx">keys</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">sortable</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumnSortDir</span><span class="p">(</span><span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="o">===</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">_elThLabel</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">title</span> <span class="o">=</span> <span class="nx">sParam</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>      
         <span class="p">}</span>
     <span class="p">});</span>

    <span class="cm">/**</span>
<span class="cm">     * @attribute MSG_SORTDESC</span>
<span class="cm">     * @description Message to display in tooltip to sort Column in descending</span>
<span class="cm">     * order. String values are treated as markup and inserted into the DOM as</span>
<span class="cm">     * innerHTML.</span>
<span class="cm">     * @type HTML</span>
<span class="cm">     * @default &quot;Click to sort descending&quot;</span>
<span class="cm">     */</span>      
     <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;MSG_SORTDESC&quot;</span><span class="p">,</span> <span class="p">{</span>      
         <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;Click to sort descending&quot;</span><span class="p">,</span>      
         <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">,</span>
         <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sParam</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">allKeys</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">getColumnSet</span><span class="p">().</span><span class="nx">keys</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">sortable</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumnSortDir</span><span class="p">(</span><span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="o">===</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">_elThLabel</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">title</span> <span class="o">=</span> <span class="nx">sParam</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>               
         <span class="p">}</span>
     <span class="p">});</span>
     
    <span class="cm">/**</span>
<span class="cm">     * @attribute currencySymbol</span>
<span class="cm">     * @deprecated Use currencyOptions.</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;currencySymbol&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="s2">&quot;$&quot;</span><span class="p">,</span>
        <span class="nx">validator</span><span class="o">:</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span>
    <span class="p">});</span>
    
    <span class="cm">/**</span>
<span class="cm">     * Default config passed to YAHOO.util.Number.format() by the &#39;currency&#39; Column formatter.</span>
<span class="cm">     * @attribute currencyOptions</span>
<span class="cm">     * @type Object</span>
<span class="cm">     * @default {prefix: $, decimalPlaces:2, decimalSeparator:&quot;.&quot;, thousandsSeparator:&quot;,&quot;}</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;currencyOptions&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">prefix</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;currencySymbol&quot;</span><span class="p">),</span> <span class="c1">// TODO: deprecate currencySymbol</span>
            <span class="nx">decimalPlaces</span><span class="o">:</span><span class="mi">2</span><span class="p">,</span>
            <span class="nx">decimalSeparator</span><span class="o">:</span><span class="s2">&quot;.&quot;</span><span class="p">,</span>
            <span class="nx">thousandsSeparator</span><span class="o">:</span><span class="s2">&quot;,&quot;</span>
        <span class="p">}</span>
    <span class="p">});</span>
    
    <span class="cm">/**</span>
<span class="cm">     * Default config passed to YAHOO.util.Date.format() by the &#39;date&#39; Column formatter.</span>
<span class="cm">     * @attribute dateOptions</span>
<span class="cm">     * @type Object</span>
<span class="cm">     * @default {format:&quot;%m/%d/%Y&quot;, locale:&quot;en&quot;}</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;dateOptions&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="p">{</span><span class="nx">format</span><span class="o">:</span><span class="s2">&quot;%m/%d/%Y&quot;</span><span class="p">,</span> <span class="nx">locale</span><span class="o">:</span><span class="s2">&quot;en&quot;</span><span class="p">}</span>
    <span class="p">});</span>
    
    <span class="cm">/**</span>
<span class="cm">     * Default config passed to YAHOO.util.Number.format() by the &#39;number&#39; Column formatter.</span>
<span class="cm">     * @attribute numberOptions</span>
<span class="cm">     * @type Object</span>
<span class="cm">     * @default {decimalPlaces:0, thousandsSeparator:&quot;,&quot;}</span>
<span class="cm">     */</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">setAttributeConfig</span><span class="p">(</span><span class="s2">&quot;numberOptions&quot;</span><span class="p">,</span> <span class="p">{</span>
        <span class="nx">value</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">decimalPlaces</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span>
            <span class="nx">thousandsSeparator</span><span class="o">:</span><span class="s2">&quot;,&quot;</span>
        <span class="p">}</span>
    <span class="p">});</span>

<span class="p">},</span>

<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Private member variables</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

<span class="cm">/**</span>
<span class="cm"> * True if instance is initialized, so as to fire the initEvent after render.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _bInit</span>
<span class="cm"> * @type Boolean</span>
<span class="cm"> * @default true</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_bInit</span> <span class="o">:</span> <span class="kc">true</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Index assigned to instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _nIndex</span>
<span class="cm"> * @type Number</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_nIndex</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Counter for IDs assigned to TR elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _nTrCount</span>
<span class="cm"> * @type Number</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_nTrCount</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Counter for IDs assigned to TD elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _nTdCount</span>
<span class="cm"> * @type Number</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_nTdCount</span> <span class="o">:</span> <span class="mi">0</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Unique id assigned to instance &quot;yui-dtN&quot;, useful prefix for generating unique</span>
<span class="cm"> * DOM ID strings and log messages.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _sId</span>
<span class="cm"> * @type String</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_sId</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Render chain.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _oChainRender</span>
<span class="cm"> * @type YAHOO.util.Chain</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_oChainRender</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the container element for the DataTable instance into which</span>
<span class="cm"> * all other elements get created.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elContainer</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elContainer</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the mask element for the DataTable instance which disables it.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elMask</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elMask</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the TABLE element for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elTable</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elTable</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the CAPTION element for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elCaption</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elCaption</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the COLGROUP element for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elColgroup</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elColgroup</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the THEAD element for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elThead</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elThead</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the primary TBODY element for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elTbody</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elTbody</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the secondary TBODY element used to display DataTable messages.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elMsgTbody</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elMsgTbody</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the secondary TBODY element&#39;s single TR element used to display DataTable messages.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elMsgTr</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elMsgTr</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DOM reference to the secondary TBODY element&#39;s single TD element used to display DataTable messages.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elMsgTd</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elMsgTd</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Element reference to shared Column drag target.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elColumnDragTarget</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elColumnDragTarget</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Element reference to shared Column resizer proxy.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elColumnResizerProxy</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elColumnResizerProxy</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * DataSource instance for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _oDataSource</span>
<span class="cm"> * @type YAHOO.util.DataSource</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_oDataSource</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * ColumnSet instance for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _oColumnSet</span>
<span class="cm"> * @type YAHOO.widget.ColumnSet</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_oColumnSet</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * RecordSet instance for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _oRecordSet</span>
<span class="cm"> * @type YAHOO.widget.RecordSet</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_oRecordSet</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * The active CellEditor instance for the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _oCellEditor</span>
<span class="cm"> * @type YAHOO.widget.CellEditor</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_oCellEditor</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * ID string of first TR element of the current DataTable page.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _sFirstTrId</span>
<span class="cm"> * @type String</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_sFirstTrId</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * ID string of the last TR element of the current DataTable page.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _sLastTrId</span>
<span class="cm"> * @type String</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_sLastTrId</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Template row to create all new rows from.</span>
<span class="cm"> * @property _elTrTemplate</span>
<span class="cm"> * @type {HTMLElement}</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_elTrTemplate</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Sparse array of custom functions to set column widths for browsers that don&#39;t</span>
<span class="cm"> * support dynamic CSS rules.  Functions are added at the index representing</span>
<span class="cm"> * the number of rows they update.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _aDynFunctions</span>
<span class="cm"> * @type Array</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_aDynFunctions</span> <span class="o">:</span> <span class="p">[],</span>

<span class="cm">/**</span>
<span class="cm"> * Disabled state.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _disabled</span>
<span class="cm"> * @type Boolean</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_disabled</span> <span class="o">:</span> <span class="kc">false</span><span class="p">,</span>




























<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Private methods</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

<span class="cm">/**</span>
<span class="cm"> * Clears browser text selection. Useful to call on rowSelectEvent or</span>
<span class="cm"> * cellSelectEvent to prevent clicks or dblclicks from selecting text in the</span>
<span class="cm"> * browser.</span>
<span class="cm"> *</span>
<span class="cm"> * @method clearTextSelection</span>
<span class="cm"> */</span>
<span class="nx">clearTextSelection</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sel</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nb">window</span><span class="p">.</span><span class="nx">getSelection</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">sel</span> <span class="o">=</span> <span class="nb">window</span><span class="p">.</span><span class="nx">getSelection</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">getSelection</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">sel</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getSelection</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">selection</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">sel</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">selection</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">sel</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">empty</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">sel</span><span class="p">.</span><span class="nx">empty</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">removeAllRanges</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">sel</span><span class="p">.</span><span class="nx">removeAllRanges</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sel</span><span class="p">.</span><span class="nx">collapse</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">sel</span><span class="p">.</span><span class="nx">collapse</span><span class="p">();</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sets focus on the given element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _focusEl</span>
<span class="cm"> * @param el {HTMLElement} Element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_focusEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">;</span>
    <span class="c1">// http://developer.mozilla.org/en/docs/index.php?title=Key-navigable_custom_DHTML_widgets</span>
    <span class="c1">// The timeout is necessary in both IE and Firefox 1.5, to prevent scripts from doing</span>
    <span class="c1">// strange unexpected things as the user clicks on buttons and other controls.</span>
    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="k">try</span> <span class="p">{</span>
            <span class="nx">el</span><span class="p">.</span><span class="nx">focus</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="k">catch</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
        <span class="p">}</span>
    <span class="p">},</span><span class="mi">0</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Forces Gecko repaint.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _repaintGecko</span>
<span class="cm"> * @el {HTMLElement} (Optional) Element to repaint, otherwise entire document body.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_repaintGecko</span> <span class="o">:</span> <span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">gecko</span><span class="p">)</span> <span class="o">?</span> 
    <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">parent</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">nextSibling</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">;</span>
        <span class="nx">parent</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">parent</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">el</span><span class="p">),</span> <span class="nx">nextSibling</span><span class="p">);</span>
    <span class="p">}</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{},</span>

<span class="cm">/**</span>
<span class="cm"> * Forces Opera repaint.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _repaintOpera</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_repaintOpera</span> <span class="o">:</span> <span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="o">?</span> 
    <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">opera</span><span class="p">)</span> <span class="p">{</span>
            <span class="nb">document</span><span class="p">.</span><span class="nx">documentElement</span><span class="p">.</span><span class="nx">className</span> <span class="o">+=</span> <span class="s2">&quot; &quot;</span><span class="p">;</span>
            <span class="nb">document</span><span class="p">.</span><span class="nx">documentElement</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">trim</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">documentElement</span><span class="p">.</span><span class="nx">className</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{}</span> <span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Forces Webkit repaint.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _repaintWebkit</span>
<span class="cm"> * @el {HTMLElement} (Optional) Element to repaint, otherwise entire document body.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_repaintWebkit</span> <span class="o">:</span> <span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">webkit</span><span class="p">)</span> <span class="o">?</span> 
    <span class="kd">function</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">el</span> <span class="o">=</span> <span class="nx">el</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">parent</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">nextSibling</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">;</span>
        <span class="nx">parent</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">parent</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">el</span><span class="p">),</span> <span class="nx">nextSibling</span><span class="p">);</span>
    <span class="p">}</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{},</span>






















<span class="c1">// INIT FUNCTIONS</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes object literal of config values.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initConfigs</span>
<span class="cm"> * @param oConfig {Object} Object literal of config values.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initConfigs</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oConfigs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oConfigs</span> <span class="o">||</span> <span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">oConfigs</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oConfigs</span> <span class="o">=</span> <span class="p">{};</span>
    <span class="p">}</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">configs</span> <span class="o">=</span> <span class="nx">oConfigs</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes ColumnSet.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initColumnSet</span>
<span class="cm"> * @param aColumnDefs {Object[]} Array of object literal Column definitions.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initColumnSet</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">aColumnDefs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">len</span><span class="p">;</span>
    
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// First clear _oDynStyles for existing ColumnSet and</span>
        <span class="c1">// uregister CellEditor Custom Events</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="nx">DT</span><span class="p">.</span><span class="nx">_oDynStyles</span><span class="p">[</span><span class="s2">&quot;.&quot;</span><span class="o">+</span><span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span><span class="o">+</span><span class="s2">&quot;-col-&quot;</span><span class="o">+</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getSanitizedKey</span><span class="p">()</span><span class="o">+</span><span class="s2">&quot; .&quot;</span><span class="o">+</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LINER</span><span class="p">]</span> <span class="o">=</span> <span class="kc">undefined</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// Backward compatibility</span>
                <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
        
        <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_clearTrTemplateEl</span><span class="p">();</span>
    <span class="p">}</span>
    
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">aColumnDefs</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span> <span class="o">=</span>  <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">ColumnSet</span><span class="p">(</span><span class="nx">aColumnDefs</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="c1">// Backward compatibility</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">aColumnDefs</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">ColumnSet</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span> <span class="o">=</span>  <span class="nx">aColumnDefs</span><span class="p">;</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable&#39;s constructor now requires an array&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; of object literal Column definitions instead of a ColumnSet instance&quot;</span><span class="p">,</span>
        <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>

    <span class="c1">// Register CellEditor Custom Events</span>
    <span class="kd">var</span> <span class="nx">allKeys</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">;</span>
    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// Backward incompatibility</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;showEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorShowEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;keydownEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorKeydownEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;revertEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorRevertEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;saveEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorSaveEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;cancelEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorCancelEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;blurEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorBlurEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;blockEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorBlockEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;unblockEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorUnblockEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes DataSource.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initDataSource</span>
<span class="cm"> * @param oDataSource {YAHOO.util.DataSource} DataSource instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initDataSource</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oDataSource</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oDataSource</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span><span class="p">(</span><span class="nx">oDataSource</span><span class="p">.</span><span class="nx">sendRequest</span><span class="p">)))</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span> <span class="o">=</span> <span class="nx">oDataSource</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Backward compatibility</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">tmpTable</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">tmpContainer</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
        <span class="c1">//TODO: this will break if re-initing DS at runtime for SDT</span>
        <span class="c1">// Peek in container child nodes to see if TABLE already exists</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">tmpContainer</span><span class="p">.</span><span class="nx">hasChildNodes</span><span class="p">())</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">tmpChildren</span> <span class="o">=</span> <span class="nx">tmpContainer</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">;</span>
            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">tmpChildren</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">tmpChildren</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">tmpChildren</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;table&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">tmpTable</span> <span class="o">=</span> <span class="nx">tmpChildren</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">tmpTable</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">tmpFieldsArray</span> <span class="o">=</span> <span class="p">[];</span>
                <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">tmpFieldsArray</span><span class="p">.</span><span class="nx">push</span><span class="p">({</span><span class="nx">key</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">key</span><span class="p">});</span>
                <span class="p">}</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">DS</span><span class="p">(</span><span class="nx">tmpTable</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">.</span><span class="nx">responseType</span> <span class="o">=</span> <span class="nx">DS</span><span class="p">.</span><span class="nx">TYPE_HTMLTABLE</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">.</span><span class="nx">responseSchema</span> <span class="o">=</span> <span class="p">{</span><span class="nx">fields</span><span class="o">:</span> <span class="nx">tmpFieldsArray</span><span class="p">};</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Null DataSource for progressive enhancement from&quot;</span> <span class="o">+</span>
                <span class="s2">&quot; markup has been deprecated&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes RecordSet.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initRecordSet</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initRecordSet</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">reset</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">RecordSet</span><span class="p">();</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes DOM elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initDomElements</span>
<span class="cm"> * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID. </span>
<span class="cm"> * return {Boolean} False in case of error, otherwise true </span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initDomElements</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Outer container</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initContainerEl</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">);</span>
    <span class="c1">// TABLE</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initTableEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">);</span>
    <span class="c1">// COLGROUP</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initColgroupEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">);</span>
    <span class="c1">// THEAD</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initTheadEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">);</span>
    
    <span class="c1">// Message TBODY</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initMsgTbodyEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">);</span>  

    <span class="c1">// Primary TBODY</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initTbodyEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span> <span class="o">||</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span> <span class="o">||</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">||</span>  <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span> <span class="o">||</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="o">||</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroy&#39;s the DataTable outer container element, if available.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyContainerEl</span>
<span class="cm"> * @param elContainer {HTMLElement} Reference to the container element. </span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyContainerEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">columns</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">,</span>
        <span class="nx">elements</span><span class="p">,</span> <span class="nx">i</span><span class="p">;</span>

        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DATATABLE</span><span class="p">);</span>

    <span class="c1">// Bug 2528783</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span> <span class="nx">elContainer</span> <span class="p">);</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">,</span> <span class="kc">true</span> <span class="p">);</span> <span class="c1">// recursive to get resize handles</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="p">);</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span> <span class="p">);</span>

    <span class="c1">// because change doesn&#39;t bubble, each select (via formatDropdown) gets</span>
    <span class="c1">// its own subscription</span>
    <span class="nx">elements</span> <span class="o">=</span> <span class="nx">elContainer</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span> <span class="s1">&#39;select&#39;</span> <span class="p">);</span>

    <span class="k">if</span> <span class="p">(</span> <span class="nx">elements</span><span class="p">.</span><span class="nx">length</span> <span class="p">)</span> <span class="p">{</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">detachListener</span><span class="p">(</span> <span class="nx">elements</span><span class="p">,</span> <span class="s1">&#39;change&#39;</span> <span class="p">);</span>
    <span class="p">}</span>

    <span class="k">for</span> <span class="p">(</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">columns</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">;</span> <span class="o">--</span><span class="nx">i</span> <span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span> <span class="p">(</span> <span class="nx">columns</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">editor</span> <span class="p">)</span> <span class="p">{</span>
            <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span> <span class="nx">columns</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">editor</span><span class="p">.</span><span class="nx">_elContainer</span> <span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="nx">elContainer</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
    
    <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes the DataTable outer container element, including a mask.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initContainerEl</span>
<span class="cm"> * @param elContainer {HTMLElement | String} HTML DIV element by reference or ID.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initContainerEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Validate container</span>
    <span class="nx">elContainer</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">);</span>
    
    <span class="k">if</span><span class="p">(</span><span class="nx">elContainer</span> <span class="o">&amp;&amp;</span> <span class="nx">elContainer</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elContainer</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;div&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Destroy previous</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_destroyContainerEl</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">);</span>

        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DATATABLE</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span> <span class="s2">&quot;focus&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableFocus</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span> <span class="s2">&quot;dblclick&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableDblclick</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span> <span class="o">=</span> <span class="nx">elContainer</span><span class="p">;</span>
        
        <span class="kd">var</span> <span class="nx">elMask</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">);</span>
        <span class="nx">elMask</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_MASK</span><span class="p">;</span>
        <span class="nx">elMask</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elMask</span> <span class="o">=</span> <span class="nx">elContainer</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">elMask</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroy&#39;s the DataTable TABLE element, if available.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyTableEl</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyTableEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTable</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">elTable</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="nx">elTable</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">elTable</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elCaption</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Creates HTML markup CAPTION element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initCaptionEl</span>
<span class="cm"> * @param sCaption {HTML} Caption value. String values are treated as markup and</span>
<span class="cm"> * inserted into the DOM with innerHTML.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initCaptionEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sCaption</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span> <span class="o">&amp;&amp;</span> <span class="nx">sCaption</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Create CAPTION element</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elCaption</span><span class="p">)</span> <span class="p">{</span> 
            <span class="k">this</span><span class="p">.</span><span class="nx">_elCaption</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">.</span><span class="nx">createCaption</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="c1">// Set CAPTION value</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elCaption</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">sCaption</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elCaption</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elCaption</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elCaption</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Creates HTML markup for TABLE, COLGROUP, THEAD and TBODY elements in outer</span>
<span class="cm"> * container element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initTableEl</span>
<span class="cm"> * @param elContainer {HTMLElement} Container element into which to create TABLE.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initTableEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Destroy previous</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_destroyTableEl</span><span class="p">();</span>
    
        <span class="c1">// Create TABLE</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span> <span class="o">=</span> <span class="nx">elContainer</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;table&quot;</span><span class="p">));</span>  
         
        <span class="c1">// Set SUMMARY attribute</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">.</span><span class="nx">summary</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;summary&quot;</span><span class="p">);</span>
        
        <span class="c1">// Create CAPTION element</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;caption&quot;</span><span class="p">))</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_initCaptionEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;caption&quot;</span><span class="p">));</span>
        <span class="p">}</span>

        <span class="c1">// Set up mouseover/mouseout events via mouseenter/mouseleave delegation</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">delegate</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">,</span> <span class="s2">&quot;mouseenter&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseover</span><span class="p">,</span> <span class="s2">&quot;thead .&quot;</span><span class="o">+</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">delegate</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">,</span> <span class="s2">&quot;mouseleave&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseout</span><span class="p">,</span> <span class="s2">&quot;thead .&quot;</span><span class="o">+</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">delegate</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">,</span> <span class="s2">&quot;mouseenter&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseover</span><span class="p">,</span> <span class="s2">&quot;tbody.yui-dt-data&gt;tr&gt;td&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">delegate</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">,</span> <span class="s2">&quot;mouseleave&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseout</span><span class="p">,</span> <span class="s2">&quot;tbody.yui-dt-data&gt;tr&gt;td&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">delegate</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">,</span> <span class="s2">&quot;mouseenter&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseover</span><span class="p">,</span> <span class="s2">&quot;tbody.yui-dt-message&gt;tr&gt;td&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">delegate</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">,</span> <span class="s2">&quot;mouseleave&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseout</span><span class="p">,</span> <span class="s2">&quot;tbody.yui-dt-message&gt;tr&gt;td&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroy&#39;s the DataTable COLGROUP element, if available.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyColgroupEl</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyColgroupEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elColgroup</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elColgroup</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elTable</span> <span class="o">=</span> <span class="nx">elColgroup</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">elColgroup</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="nx">elTable</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">elColgroup</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes COLGROUP and COL elements for managing minWidth.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initColgroupEl</span>
<span class="cm"> * @param elTable {HTMLElement} TABLE element into which to create COLGROUP.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initColgroupEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Destroy previous</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_destroyColgroupEl</span><span class="p">();</span>

        <span class="c1">// Add COLs to DOCUMENT FRAGMENT</span>
        <span class="kd">var</span> <span class="nx">allCols</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aColIds</span> <span class="o">||</span> <span class="p">[],</span>
            <span class="nx">allKeys</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">,</span>
            <span class="nx">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">len</span> <span class="o">=</span> <span class="nx">allCols</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
            <span class="nx">elCol</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span>
            <span class="nx">elFragment</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createDocumentFragment</span><span class="p">(),</span>
            <span class="nx">elColTemplate</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;col&quot;</span><span class="p">);</span>
    
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span><span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="nx">elCol</span> <span class="o">=</span> <span class="nx">elFragment</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">elColTemplate</span><span class="p">.</span><span class="nx">cloneNode</span><span class="p">(</span><span class="kc">false</span><span class="p">));</span>
        <span class="p">}</span>
    
        <span class="c1">// Create COLGROUP</span>
        <span class="kd">var</span> <span class="nx">elColgroup</span> <span class="o">=</span> <span class="nx">elTable</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;colgroup&quot;</span><span class="p">),</span> <span class="nx">elTable</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">);</span>
        <span class="nx">elColgroup</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">elFragment</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">=</span> <span class="nx">elColgroup</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Adds a COL element to COLGROUP at given index.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _insertColgroupColEl</span>
<span class="cm"> * @param index {Number} Index of new COL element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_insertColgroupColEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span><span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">nextSibling</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">index</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;col&quot;</span><span class="p">),</span> <span class="nx">nextSibling</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Removes a COL element to COLGROUP at given index.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _removeColgroupColEl</span>
<span class="cm"> * @param index {Number} Index of removed COL element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_removeColgroupColEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">index</span><span class="p">])</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">index</span><span class="p">]);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Reorders a COL element from old index(es) to new index.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _reorderColgroupColEl</span>
<span class="cm"> * @param aKeyIndexes {Number[]} Array of indexes of removed COL element.</span>
<span class="cm"> * @param newIndex {Number} New index. </span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_reorderColgroupColEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">aKeyIndexes</span><span class="p">,</span> <span class="nx">newIndex</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">aKeyIndexes</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">newIndex</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="nx">aKeyIndexes</span><span class="p">[</span><span class="nx">aKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">]))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span>
            <span class="nx">tmpCols</span> <span class="o">=</span> <span class="p">[];</span>
        <span class="c1">// Remove COL</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">aKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">tmpCols</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">aKeyIndexes</span><span class="p">[</span><span class="nx">i</span><span class="p">]]));</span>
        <span class="p">}</span>
        <span class="c1">// Insert COL</span>
        <span class="kd">var</span> <span class="nx">nextSibling</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">newIndex</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">tmpCols</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">tmpCols</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">nextSibling</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroy&#39;s the DataTable THEAD element, if available.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyTheadEl</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyTheadEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elThead</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elThead</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elTable</span> <span class="o">=</span> <span class="nx">elThead</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">elThead</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_destroyColumnHelpers</span><span class="p">();</span>
        <span class="nx">elTable</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">elThead</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes THEAD element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initTheadEl</span>
<span class="cm"> * @param elTable {HTMLElement} TABLE element into which to create COLGROUP.</span>
<span class="cm"> * @param {HTMLElement} Initialized THEAD element. </span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initTheadEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">elTable</span> <span class="o">=</span> <span class="nx">elTable</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">;</span>
    
    <span class="k">if</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Destroy previous</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_destroyTheadEl</span><span class="p">();</span>
    
        <span class="c1">//TODO: append to DOM later for performance</span>
        <span class="kd">var</span> <span class="nx">elThead</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">)</span> <span class="o">?</span>
            <span class="nx">elTable</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;thead&quot;</span><span class="p">),</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">nextSibling</span><span class="p">)</span> <span class="o">:</span>
            <span class="nx">elTable</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;thead&quot;</span><span class="p">));</span>
    
        <span class="c1">// Set up DOM events for THEAD</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elThead</span><span class="p">,</span> <span class="s2">&quot;focus&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTheadFocus</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elThead</span><span class="p">,</span> <span class="s2">&quot;keydown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTheadKeydown</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elThead</span><span class="p">,</span> <span class="s2">&quot;mousedown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMousedown</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elThead</span><span class="p">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseup</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elThead</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTheadClick</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        
        <span class="c1">// Bug 2528073: mouseover/mouseout handled via mouseenter/mouseleave</span>
        <span class="c1">// delegation at the TABLE level</span>

        <span class="c1">// Since we can&#39;t listen for click and dblclick on the same element...</span>
        <span class="c1">// Attach separately to THEAD and TBODY</span>
        <span class="c1">///Ev.addListener(elThead, &quot;dblclick&quot;, this._onTableDblclick, this);</span>
        
       <span class="kd">var</span> <span class="nx">oColumnSet</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">,</span>
            <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span><span class="nx">j</span><span class="p">,</span> <span class="nx">l</span><span class="p">;</span>
        
        <span class="c1">// Add TRs to the THEAD</span>
        <span class="kd">var</span> <span class="nx">colTree</span> <span class="o">=</span> <span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">elTh</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">colTree</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">elTheadTr</span> <span class="o">=</span> <span class="nx">elThead</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;tr&quot;</span><span class="p">));</span>
    
            <span class="c1">// ...and create TH cells</span>
            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">colTree</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">colTree</span><span class="p">[</span><span class="nx">i</span><span class="p">][</span><span class="nx">j</span><span class="p">];</span>
                <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">elTheadTr</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;th&quot;</span><span class="p">));</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_initThEl</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span><span class="nx">oColumn</span><span class="p">);</span>
            <span class="p">}</span>
    
                <span class="c1">// Set FIRST/LAST on THEAD rows</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">i</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTheadTr</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_FIRST</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">i</span> <span class="o">===</span> <span class="p">(</span><span class="nx">colTree</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTheadTr</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LAST</span><span class="p">);</span>
                <span class="p">}</span>

        <span class="p">}</span>

        <span class="c1">// Set FIRST/LAST on edge TH elements using the values in ColumnSet headers array</span>
        <span class="kd">var</span> <span class="nx">aFirstHeaders</span> <span class="o">=</span> <span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">headers</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">||</span> <span class="p">[];</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">aFirstHeaders</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span><span class="s2">&quot;-th-&quot;</span><span class="o">+</span><span class="nx">aFirstHeaders</span><span class="p">[</span><span class="nx">i</span><span class="p">]),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_FIRST</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="kd">var</span> <span class="nx">aLastHeaders</span> <span class="o">=</span> <span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">headers</span><span class="p">[</span><span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">headers</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">||</span> <span class="p">[];</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">aLastHeaders</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span><span class="s2">&quot;-th-&quot;</span><span class="o">+</span><span class="nx">aLastHeaders</span><span class="p">[</span><span class="nx">i</span><span class="p">]),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LAST</span><span class="p">);</span>
        <span class="p">}</span>
        
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;TH cells for &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">.</span><span class="nx">length</span> <span class="o">+</span> <span class="s2">&quot; keys created&quot;</span><span class="p">,</span><span class="s2">&quot;info&quot;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>

        <span class="c1">///TODO: try _repaintGecko(this._elContainer) instead</span>
        <span class="c1">// Bug 1806891</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="nx">ua</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&lt;</span> <span class="mi">420</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">oSelf</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
            <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                <span class="nx">elThead</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
            <span class="p">},</span><span class="mi">0</span><span class="p">);</span>
            <span class="nx">elThead</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;none&#39;</span><span class="p">;</span>
        <span class="p">}</span>
        
        <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span> <span class="o">=</span> <span class="nx">elThead</span><span class="p">;</span>
        
        <span class="c1">// Column helpers needs _elThead to exist</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnHelpers</span><span class="p">();</span>  
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Populates TH element as defined by Column.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initThEl</span>
<span class="cm"> * @param elTh {HTMLElement} TH element reference.</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column object.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initThEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">elTh</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;-th-&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getSanitizedKey</span><span class="p">();</span> <span class="c1">// Needed for accessibility, getColumn by TH, and ColumnDD</span>
    <span class="nx">elTh</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
    <span class="nx">elTh</span><span class="p">.</span><span class="nx">rowSpan</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getRowspan</span><span class="p">();</span>
    <span class="nx">elTh</span><span class="p">.</span><span class="nx">colSpan</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getColspan</span><span class="p">();</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_elTh</span> <span class="o">=</span> <span class="nx">elTh</span><span class="p">;</span>
    
    <span class="kd">var</span> <span class="nx">elThLiner</span> <span class="o">=</span> <span class="nx">elTh</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">));</span>
    <span class="nx">elThLiner</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">elTh</span><span class="p">.</span><span class="nx">id</span> <span class="o">+</span> <span class="s2">&quot;-liner&quot;</span><span class="p">;</span> <span class="c1">// Needed for resizer</span>
    <span class="nx">elThLiner</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LINER</span><span class="p">;</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_elThLiner</span> <span class="o">=</span> <span class="nx">elThLiner</span><span class="p">;</span>
    
    <span class="kd">var</span> <span class="nx">elThLabel</span> <span class="o">=</span> <span class="nx">elThLiner</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;span&quot;</span><span class="p">));</span>
    <span class="nx">elThLabel</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">;</span>    

    <span class="c1">// Assign abbr attribute</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">abbr</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">elTh</span><span class="p">.</span><span class="nx">abbr</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">abbr</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Clear minWidth on hidden Columns</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">hidden</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_clearMinWidth</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="p">}</span>
        
    <span class="nx">elTh</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getColumnClassNames</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
            
    <span class="c1">// Set Column width...</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Validate minWidth</span>
        <span class="kd">var</span> <span class="nx">nWidth</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span> <span class="o">&lt;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span><span class="p">))</span> <span class="o">?</span>
                <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">:</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span><span class="p">;</span>
        <span class="c1">// ...for fallback cases</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">_bDynStylesFallback</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elTh</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">overflow</span> <span class="o">=</span> <span class="s1">&#39;hidden&#39;</span><span class="p">;</span>
            <span class="nx">elTh</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">nWidth</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">;</span>        
        <span class="p">}</span>
        <span class="c1">// ...for non fallback cases</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidthDynStyles</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">nWidth</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">,</span> <span class="s1">&#39;hidden&#39;</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">formatTheadCell</span><span class="p">(</span><span class="nx">elThLabel</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">));</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_elThLabel</span> <span class="o">=</span> <span class="nx">elThLabel</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Outputs markup into the given TH based on given Column.</span>
<span class="cm"> *</span>
<span class="cm"> * @method formatTheadCell</span>
<span class="cm"> * @param elCellLabel {HTMLElement} The label SPAN element within the TH liner,</span>
<span class="cm"> * not the liner DIV element.     </span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param oSortedBy {Object} Sort state object literal.</span>
<span class="cm">*/</span>
<span class="nx">formatTheadCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elCellLabel</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oSortedBy</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sKey</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKey</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">sLabel</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">label</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">label</span> <span class="o">:</span> <span class="nx">sKey</span><span class="p">;</span>

    <span class="c1">// Add accessibility link for sortable Columns</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortable</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Calculate the direction</span>
        <span class="kd">var</span> <span class="nx">sSortClass</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumnSortDir</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oSortedBy</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">bDesc</span> <span class="o">=</span> <span class="p">(</span><span class="nx">sSortClass</span> <span class="o">===</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">);</span>

        <span class="c1">// This is the sorted Column</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oSortedBy</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">key</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">bDesc</span> <span class="o">=</span> <span class="o">!</span><span class="p">(</span><span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">===</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="c1">// Generate a unique HREF for visited status</span>
        <span class="kd">var</span> <span class="nx">sHref</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;-href-&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getSanitizedKey</span><span class="p">();</span>
        
        <span class="c1">// Generate a dynamic TITLE for sort status</span>
        <span class="kd">var</span> <span class="nx">sTitle</span> <span class="o">=</span> <span class="p">(</span><span class="nx">bDesc</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_SORTDESC&quot;</span><span class="p">)</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_SORTASC&quot;</span><span class="p">);</span>
        
        <span class="c1">// Format the element</span>
        <span class="nx">elCellLabel</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&lt;a href=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">sHref</span> <span class="o">+</span> <span class="s2">&quot;\&quot; title=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">sTitle</span> <span class="o">+</span> <span class="s2">&quot;\&quot; class=\&quot;&quot;</span> <span class="o">+</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SORTABLE</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&gt;&quot;</span> <span class="o">+</span> <span class="nx">sLabel</span> <span class="o">+</span> <span class="s2">&quot;&lt;/a&gt;&quot;</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Just display the label for non-sortable Columns</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">elCellLabel</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">sLabel</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Disables DD from top-level Column TH elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyDraggableColumns</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyDraggableColumns</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">elTh</span><span class="p">;</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="nx">i</span><span class="p">];</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">_dd</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_dd</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_dd</span><span class="p">.</span><span class="nx">unreg</span><span class="p">();</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">(),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DRAGGABLE</span><span class="p">);</span>       
        <span class="p">}</span>
    <span class="p">}</span>
    
    <span class="c1">// Destroy column drag proxy</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyColumnDragTargetEl</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes top-level Column TH elements into DD instances.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initDraggableColumns</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initDraggableColumns</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyDraggableColumns</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">util</span><span class="p">.</span><span class="nx">DD</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">elTh</span><span class="p">,</span> <span class="nx">elDragTarget</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="nx">i</span><span class="p">];</span>
            <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DRAGGABLE</span><span class="p">);</span>
            <span class="nx">elDragTarget</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnDragTargetEl</span><span class="p">();</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_dd</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">ColumnDD</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">elTh</span><span class="p">,</span> <span class="nx">elDragTarget</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not find DragDrop for draggable Columns&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroys shared Column drag target.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyColumnDragTargetEl</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyColumnDragTargetEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColumnDragTarget</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnDragTarget</span><span class="p">;</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnDragTarget</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Creates HTML markup for shared Column drag target.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initColumnDragTargetEl</span>
<span class="cm"> * @return {HTMLElement} Reference to Column drag target.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initColumnDragTargetEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColumnDragTarget</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Attach Column drag target element as first child of body</span>
        <span class="kd">var</span> <span class="nx">elColumnDragTarget</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
        <span class="nx">elColumnDragTarget</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;-coltarget&quot;</span><span class="p">;</span>
        <span class="nx">elColumnDragTarget</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_COLTARGET</span><span class="p">;</span>
        <span class="nx">elColumnDragTarget</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
        <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">elColumnDragTarget</span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">);</span>

        <span class="c1">// Internal tracker of Column drag target</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnDragTarget</span> <span class="o">=</span> <span class="nx">elColumnDragTarget</span><span class="p">;</span>

    <span class="p">}</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnDragTarget</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Disables resizeability on key Column TH elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyResizeableColumns</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyResizeableColumns</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">aKeys</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">;</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">aKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">aKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">_ddResizer</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">aKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">_ddResizer</span> <span class="o">=</span> <span class="nx">aKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">_ddResizer</span><span class="p">.</span><span class="nx">unreg</span><span class="p">();</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">aKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getThEl</span><span class="p">(),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_RESIZEABLE</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="c1">// Destroy resizer proxy</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyColumnResizerProxyEl</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes resizeability on key Column TH elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initResizeableColumns</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initResizeableColumns</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyResizeableColumns</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">util</span><span class="p">.</span><span class="nx">DD</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">elTh</span><span class="p">,</span> <span class="nx">elThLiner</span><span class="p">,</span> <span class="nx">elThResizerLiner</span><span class="p">,</span> <span class="nx">elThResizer</span><span class="p">,</span> <span class="nx">elResizerProxy</span><span class="p">,</span> <span class="nx">cancelClick</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">resizeable</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
                <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_RESIZEABLE</span><span class="p">);</span>
                <span class="nx">elThLiner</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThLinerEl</span><span class="p">();</span>
                
                <span class="c1">// Bug 1915349: So resizer is as tall as TH when rowspan &gt; 1</span>
                <span class="c1">// Create a separate resizer liner with position:relative</span>
                <span class="nx">elThResizerLiner</span> <span class="o">=</span> <span class="nx">elTh</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">));</span>
                <span class="nx">elThResizerLiner</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_RESIZERLINER</span><span class="p">;</span>
                
                <span class="c1">// Move TH contents into the new resizer liner</span>
                <span class="nx">elThResizerLiner</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">elThLiner</span><span class="p">);</span>
                
                <span class="c1">// Create the resizer</span>
                <span class="nx">elThResizer</span> <span class="o">=</span> <span class="nx">elThResizerLiner</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">));</span>
                <span class="nx">elThResizer</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">elTh</span><span class="p">.</span><span class="nx">id</span> <span class="o">+</span> <span class="s2">&quot;-resizer&quot;</span><span class="p">;</span> <span class="c1">// Needed for ColumnResizer</span>
                <span class="nx">elThResizer</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_RESIZER</span><span class="p">;</span>
                <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_elResizer</span> <span class="o">=</span> <span class="nx">elThResizer</span><span class="p">;</span>

                <span class="c1">// Create the resizer proxy, once per instance</span>
                <span class="nx">elResizerProxy</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnResizerProxyEl</span><span class="p">();</span>
                <span class="nx">oColumn</span><span class="p">.</span><span class="nx">_ddResizer</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">ColumnResizer</span><span class="p">(</span>
                        <span class="k">this</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">elTh</span><span class="p">,</span> <span class="nx">elThResizer</span><span class="p">,</span> <span class="nx">elResizerProxy</span><span class="p">);</span>
                <span class="nx">cancelClick</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Ev</span><span class="p">.</span><span class="nx">stopPropagation</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
                <span class="p">};</span>
                <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elThResizer</span><span class="p">,</span><span class="s2">&quot;click&quot;</span><span class="p">,</span><span class="nx">cancelClick</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not find DragDrop for resizeable Columns&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroys shared Column resizer proxy.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyColumnResizerProxyEl</span>
<span class="cm"> * @return {HTMLElement} Reference to Column resizer proxy.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyColumnResizerProxyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColumnResizerProxy</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnResizerProxy</span><span class="p">;</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
        <span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnResizerProxy</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Creates HTML markup for shared Column resizer proxy.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initColumnResizerProxyEl</span>
<span class="cm"> * @return {HTMLElement} Reference to Column resizer proxy.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initColumnResizerProxyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_elColumnResizerProxy</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Attach Column resizer element as first child of body</span>
        <span class="kd">var</span> <span class="nx">elColumnResizerProxy</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">);</span>
        <span class="nx">elColumnResizerProxy</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;-colresizerproxy&quot;</span><span class="p">;</span> <span class="c1">// Needed for ColumnResizer</span>
        <span class="nx">elColumnResizerProxy</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_RESIZERPROXY</span><span class="p">;</span>
        <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">elColumnResizerProxy</span><span class="p">,</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">);</span>

        <span class="c1">// Internal tracker of Column resizer proxy</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnResizerProxy</span> <span class="o">=</span> <span class="nx">elColumnResizerProxy</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColumnResizerProxy</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroys elements associated with Column functionality: ColumnDD and ColumnResizers.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyColumnHelpers</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyColumnHelpers</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyDraggableColumns</span><span class="p">();</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyResizeableColumns</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes elements associated with Column functionality: ColumnDD and ColumnResizers.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initColumnHelpers</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initColumnHelpers</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;draggableColumns&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_initDraggableColumns</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initResizeableColumns</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroy&#39;s the DataTable TBODY element, if available.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyTbodyEl</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyTbodyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTbody</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elTable</span> <span class="o">=</span> <span class="nx">elTbody</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="nx">elTable</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes TBODY element for data.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initTbodyEl</span>
<span class="cm"> * @param elTable {HTMLElement} TABLE element into which to create TBODY .</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initTbodyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Destroy previous</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_destroyTbodyEl</span><span class="p">();</span>
        
        <span class="c1">// Create TBODY</span>
        <span class="kd">var</span> <span class="nx">elTbody</span> <span class="o">=</span> <span class="nx">elTable</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;tbody&quot;</span><span class="p">));</span>
        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DATA</span><span class="p">;</span>
    
        <span class="c1">// Set up DOM events for TBODY</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">,</span> <span class="s2">&quot;focus&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTbodyFocus</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">,</span> <span class="s2">&quot;mousedown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMousedown</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseup</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">,</span> <span class="s2">&quot;keydown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTbodyKeydown</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTbodyClick</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>

        <span class="c1">// Bug 2528073: mouseover/mouseout handled via mouseenter/mouseleave</span>
        <span class="c1">// delegation at the TABLE level</span>

        <span class="c1">// Since we can&#39;t listen for click and dblclick on the same element...</span>
        <span class="c1">// Attach separately to THEAD and TBODY</span>
        <span class="c1">///Ev.addListener(elTbody, &quot;dblclick&quot;, this._onTableDblclick, this);</span>
        
    
        <span class="c1">// IE puts focus outline in the wrong place</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">ie</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elTbody</span><span class="p">.</span><span class="nx">hideFocus</span><span class="o">=</span><span class="kc">true</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="o">=</span> <span class="nx">elTbody</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroy&#39;s the DataTable message TBODY element, if available.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyMsgTbodyEl</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyMsgTbodyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elMsgTbody</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elTable</span> <span class="o">=</span> <span class="nx">elMsgTbody</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
        <span class="nx">elTable</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initializes TBODY element for messaging.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initMsgTbodyEl</span>
<span class="cm"> * @param elTable {HTMLElement} TABLE element into which to create TBODY </span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initMsgTbodyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTable</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elMsgTbody</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;tbody&quot;</span><span class="p">);</span>
        <span class="nx">elMsgTbody</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_MESSAGE</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">elMsgTr</span> <span class="o">=</span> <span class="nx">elMsgTbody</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;tr&quot;</span><span class="p">));</span>
        <span class="nx">elMsgTr</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_FIRST</span> <span class="o">+</span> <span class="s2">&quot; &quot;</span> <span class="o">+</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LAST</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTr</span> <span class="o">=</span> <span class="nx">elMsgTr</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">elMsgTd</span> <span class="o">=</span> <span class="nx">elMsgTr</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;td&quot;</span><span class="p">));</span>
        <span class="nx">elMsgTd</span><span class="p">.</span><span class="nx">colSpan</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">.</span><span class="nx">length</span> <span class="o">||</span> <span class="mi">1</span><span class="p">;</span>
        <span class="nx">elMsgTd</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_FIRST</span> <span class="o">+</span> <span class="s2">&quot; &quot;</span> <span class="o">+</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LAST</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTd</span> <span class="o">=</span> <span class="nx">elMsgTd</span><span class="p">;</span>
        <span class="nx">elMsgTbody</span> <span class="o">=</span> <span class="nx">elTable</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">elMsgLiner</span> <span class="o">=</span> <span class="nx">elMsgTd</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">));</span>
        <span class="nx">elMsgLiner</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LINER</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span> <span class="o">=</span> <span class="nx">elMsgTbody</span><span class="p">;</span>

        <span class="c1">// Set up DOM events for TBODY</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">,</span> <span class="s2">&quot;focus&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTbodyFocus</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">,</span> <span class="s2">&quot;mousedown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMousedown</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">,</span> <span class="s2">&quot;mouseup&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTableMouseup</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">,</span> <span class="s2">&quot;keydown&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTbodyKeydown</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elMsgTbody</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTbodyClick</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>

        <span class="c1">// Bug 2528073: mouseover/mouseout handled via mouseenter/mouseleave</span>
        <span class="c1">// delegation at the TABLE level</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Initialize internal event listeners</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initEvents</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_initEvents</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Initialize Column sort</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnSort</span><span class="p">();</span>
        
    <span class="c1">// Add the document level click listener</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentClick</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>

    <span class="c1">// Paginator integration</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;paginatorChange&quot;</span><span class="p">,</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handlePaginatorChange</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span><span class="nx">arguments</span><span class="p">);</span>
    <span class="p">});</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;initEvent&quot;</span><span class="p">,</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">renderPaginator</span><span class="p">();</span>
    <span class="p">});</span>

    <span class="c1">// Initialize CellEditor integration</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initCellEditing</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**      </span>
<span class="cm">  * Initializes Column sorting.      </span>
<span class="cm">  *      </span>
<span class="cm">  * @method _initColumnSort      </span>
<span class="cm">  * @private      </span>
<span class="cm">  */</span>      
<span class="nx">_initColumnSort</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;theadCellClickEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">onEventSortColumn</span><span class="p">);</span>      

    <span class="c1">// Backward compatibility</span>
    <span class="kd">var</span> <span class="nx">oSortedBy</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oSortedBy</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">==</span> <span class="s2">&quot;desc&quot;</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">.</span><span class="nx">value</span><span class="p">.</span><span class="nx">dir</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">==</span> <span class="s2">&quot;asc&quot;</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_configs</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">.</span><span class="nx">value</span><span class="p">.</span><span class="nx">dir</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**      </span>
<span class="cm">  * Initializes CellEditor integration.      </span>
<span class="cm">  *      </span>
<span class="cm">  * @method _initCellEditing      </span>
<span class="cm">  * @private      </span>
<span class="cm">  */</span>      
<span class="nx">_initCellEditing</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;editorBlurEvent&quot;</span><span class="p">,</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">onEditorBlurEvent</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span><span class="nx">arguments</span><span class="p">);</span>
    <span class="p">});</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;editorBlockEvent&quot;</span><span class="p">,</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">onEditorBlockEvent</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span><span class="nx">arguments</span><span class="p">);</span>
    <span class="p">});</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;editorUnblockEvent&quot;</span><span class="p">,</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">onEditorUnblockEvent</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="k">this</span><span class="p">,</span><span class="nx">arguments</span><span class="p">);</span>
    <span class="p">});</span>
<span class="p">},</span>

































<span class="c1">// DOM MUTATION FUNCTIONS</span>

<span class="cm">/**</span>
<span class="cm"> * Retruns classnames to represent current Column states.</span>
<span class="cm"> * @method _getColumnClassnames </span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param aAddClasses {String[]} An array of additional classnames to add to the</span>
<span class="cm"> * return value.  </span>
<span class="cm"> * @return {String} A String of classnames to be assigned to TH or TD elements</span>
<span class="cm"> * for given Column.  </span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_getColumnClassNames</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">aAddClasses</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">allClasses</span><span class="p">;</span>
    
    <span class="c1">// Add CSS classes</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">className</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Single custom class</span>
        <span class="nx">allClasses</span> <span class="o">=</span> <span class="p">[</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">className</span><span class="p">];</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">className</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Array of custom classes</span>
        <span class="nx">allClasses</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">className</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="c1">// no custom classes</span>
        <span class="nx">allClasses</span> <span class="o">=</span> <span class="p">[];</span>
    <span class="p">}</span>
    
    <span class="c1">// Hook for setting width with via dynamic style uses key since ID is too disposable</span>
    <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;-col-&quot;</span> <span class="o">+</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getSanitizedKey</span><span class="p">();</span>

    <span class="c1">// Column key - minus any chars other than &quot;A-Z&quot;, &quot;a-z&quot;, &quot;0-9&quot;, &quot;_&quot;, &quot;-&quot;, &quot;.&quot;, or &quot;:&quot;</span>
    <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="s2">&quot;yui-dt-col-&quot;</span> <span class="o">+</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getSanitizedKey</span><span class="p">();</span>

    <span class="kd">var</span> <span class="nx">isSortedBy</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">{};</span>
    <span class="c1">// Sorted</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="nx">isSortedBy</span><span class="p">.</span><span class="nx">key</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">isSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">||</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Hidden</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">hidden</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIDDEN</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Selected</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">selected</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Sortable</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortable</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SORTABLE</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Resizeable</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">resizeable</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_RESIZEABLE</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Editable</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">allClasses</span><span class="p">[</span><span class="nx">allClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_EDITABLE</span><span class="p">;</span>
    <span class="p">}</span>
    
    <span class="c1">// Addtnl classes, including First/Last</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">aAddClasses</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">allClasses</span> <span class="o">=</span> <span class="nx">allClasses</span><span class="p">.</span><span class="nx">concat</span><span class="p">(</span><span class="nx">aAddClasses</span><span class="p">);</span>
    <span class="p">}</span>
    
    <span class="k">return</span> <span class="nx">allClasses</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39; &#39;</span><span class="p">);</span>  
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Clears TR element template in response to any Column state change.</span>
<span class="cm"> * @method _clearTrTemplateEl</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_clearTrTemplateEl</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_elTrTemplate</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns a new TR element template with TD elements classed with current</span>
<span class="cm"> * Column states.</span>
<span class="cm"> * @method _getTrTemplateEl </span>
<span class="cm"> * @return {HTMLElement} A TR element to be cloned and added to the DOM.</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_getTrTemplateEl</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Template is already available</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTrTemplate</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTrTemplate</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Template needs to be created</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">d</span>   <span class="o">=</span> <span class="nb">document</span><span class="p">,</span>
            <span class="nx">tr</span>  <span class="o">=</span> <span class="nx">d</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;tr&#39;</span><span class="p">),</span>
            <span class="nx">td</span>  <span class="o">=</span> <span class="nx">d</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;td&#39;</span><span class="p">),</span>
            <span class="nx">div</span> <span class="o">=</span> <span class="nx">d</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
    
        <span class="c1">// Append the liner element</span>
        <span class="nx">td</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">div</span><span class="p">);</span>

        <span class="c1">// Create TD elements into DOCUMENT FRAGMENT</span>
        <span class="kd">var</span> <span class="nx">df</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createDocumentFragment</span><span class="p">(),</span>
            <span class="nx">allKeys</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">,</span>
            <span class="nx">elTd</span><span class="p">;</span>

        <span class="c1">// Set state for each TD;</span>
        <span class="kd">var</span> <span class="nx">aAddClasses</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">keysLen</span><span class="o">=</span><span class="nx">allKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">keysLen</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Clone the TD template</span>
            <span class="nx">elTd</span> <span class="o">=</span> <span class="nx">td</span><span class="p">.</span><span class="nx">cloneNode</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>

            <span class="c1">// Format the base TD</span>
            <span class="nx">elTd</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_formatTdEl</span><span class="p">(</span><span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">elTd</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="p">(</span><span class="nx">i</span><span class="o">===</span><span class="nx">keysLen</span><span class="o">-</span><span class="mi">1</span><span class="p">));</span>
                        
            <span class="nx">df</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">elTd</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="nx">tr</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">df</span><span class="p">);</span>
        <span class="nx">tr</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_REC</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTrTemplate</span> <span class="o">=</span> <span class="nx">tr</span><span class="p">;</span>
        <span class="k">return</span> <span class="nx">tr</span><span class="p">;</span>
    <span class="p">}</span>   
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Formats a basic TD element.</span>
<span class="cm"> * @method _formatTdEl </span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Associated Column instance. </span>
<span class="cm"> * @param elTd {HTMLElement} An unformatted TD element.</span>
<span class="cm"> * @param index {Number} Column key index. </span>
<span class="cm"> * @param isLast {Boolean} True if Column is last key of the ColumnSet.</span>
<span class="cm"> * @return {HTMLElement} A formatted TD element.</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_formatTdEl</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">elTd</span><span class="p">,</span> <span class="nx">index</span><span class="p">,</span> <span class="nx">isLast</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oColumnSet</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">;</span>
    
    <span class="c1">// Set the TD&#39;s accessibility headers</span>
    <span class="kd">var</span> <span class="nx">allHeaders</span> <span class="o">=</span> <span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">headers</span><span class="p">,</span>
        <span class="nx">allColHeaders</span> <span class="o">=</span> <span class="nx">allHeaders</span><span class="p">[</span><span class="nx">index</span><span class="p">],</span>
        <span class="nx">sTdHeaders</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
        <span class="nx">sHeader</span><span class="p">;</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">headersLen</span><span class="o">=</span><span class="nx">allColHeaders</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span> <span class="o">&lt;</span> <span class="nx">headersLen</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">sHeader</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">+</span> <span class="s2">&quot;-th-&quot;</span> <span class="o">+</span> <span class="nx">allColHeaders</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">+</span> <span class="s1">&#39; &#39;</span><span class="p">;</span>
        <span class="nx">sTdHeaders</span> <span class="o">+=</span> <span class="nx">sHeader</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">elTd</span><span class="p">.</span><span class="nx">headers</span> <span class="o">=</span> <span class="nx">sTdHeaders</span><span class="p">;</span>
    
    <span class="c1">// Class the TD element</span>
    <span class="kd">var</span> <span class="nx">aAddClasses</span> <span class="o">=</span> <span class="p">[];</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">index</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">aAddClasses</span><span class="p">[</span><span class="nx">aAddClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_FIRST</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">isLast</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">aAddClasses</span><span class="p">[</span><span class="nx">aAddClasses</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LAST</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">elTd</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getColumnClassNames</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">aAddClasses</span><span class="p">);</span>

    <span class="c1">// Class the liner element</span>
    <span class="nx">elTd</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LINER</span><span class="p">;</span>

    <span class="c1">// Set Column width for fallback cases</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span> <span class="o">&amp;&amp;</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">_bDynStylesFallback</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Validate minWidth</span>
        <span class="kd">var</span> <span class="nx">nWidth</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span> <span class="o">&lt;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span><span class="p">))</span> <span class="o">?</span>
                <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">:</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span><span class="p">;</span>
        <span class="nx">elTd</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">overflow</span> <span class="o">=</span> <span class="s1">&#39;hidden&#39;</span><span class="p">;</span>
        <span class="nx">elTd</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">nWidth</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">;</span>
    <span class="p">}</span>
    
    <span class="k">return</span> <span class="nx">elTd</span><span class="p">;</span>
<span class="p">},</span>


<span class="cm">/**</span>
<span class="cm"> * Create a new TR element for a given Record and appends it with the correct</span>
<span class="cm"> * number of Column-state-classed TD elements. Striping is the responsibility of</span>
<span class="cm"> * the calling function, which may decide to stripe the single row, a subset of</span>
<span class="cm"> * rows, or all the rows.</span>
<span class="cm"> * @method _createTrEl</span>
<span class="cm"> * @param oRecord {YAHOO.widget.Record} Record instance</span>
<span class="cm"> * @return {HTMLElement} The new TR element.  This must be added to the DOM.</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_addTrEl</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTrTemplate</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getTrTemplateEl</span><span class="p">();</span>
    
    <span class="c1">// Clone the TR template.</span>
    <span class="kd">var</span> <span class="nx">elTr</span> <span class="o">=</span> <span class="nx">elTrTemplate</span><span class="p">.</span><span class="nx">cloneNode</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
    
    <span class="c1">// Populate content</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_updateTrEl</span><span class="p">(</span><span class="nx">elTr</span><span class="p">,</span><span class="nx">oRecord</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Formats the contents of the given TR&#39;s TD elements with data from the given</span>
<span class="cm"> * Record. Only innerHTML should change, nothing structural.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _updateTrEl</span>
<span class="cm"> * @param elTr {HTMLElement} The TR element to update.</span>
<span class="cm"> * @param oRecord {YAHOO.widget.Record} The associated Record instance.</span>
<span class="cm"> * @return {HTMLElement} DOM reference to the new TR element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_updateTrEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elTr</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;formatRow&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;formatRow&quot;</span><span class="p">).</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">elTr</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">)</span> <span class="o">:</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">ok</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Hide the row to prevent constant reflows</span>
        <span class="nx">elTr</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;none&#39;</span><span class="p">;</span>
        
        <span class="c1">// Update TD elements with new data</span>
        <span class="kd">var</span> <span class="nx">allTds</span> <span class="o">=</span> <span class="nx">elTr</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">,</span>
            <span class="nx">elTd</span><span class="p">;</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span><span class="nx">len</span><span class="o">=</span><span class="nx">allTds</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elTd</span> <span class="o">=</span> <span class="nx">allTds</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            
            <span class="c1">// Set the cell content</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">formatCell</span><span class="p">(</span><span class="nx">allTds</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">firstChild</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
        <span class="p">}</span>
        
        <span class="c1">// Redisplay the row for reflow</span>
        <span class="nx">elTr</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
    <span class="p">}</span>
    
     <span class="c1">// Record-to-TR association and tracking of FIRST/LAST</span>
    <span class="kd">var</span> <span class="nx">oldId</span> <span class="o">=</span> <span class="nx">elTr</span><span class="p">.</span><span class="nx">id</span><span class="p">,</span>
        <span class="nx">newId</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_sFirstTrId</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_sFirstTrId</span> <span class="o">=</span> <span class="nx">newId</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_sLastTrId</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_sLastTrId</span> <span class="o">=</span> <span class="nx">newId</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">elTr</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">newId</span><span class="p">;</span>
    <span class="k">return</span> <span class="nx">elTr</span><span class="p">;</span>
<span class="p">},</span>


<span class="cm">/**</span>
<span class="cm"> * Deletes TR element by DOM reference or by DataTable page row index.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _deleteTrEl</span>
<span class="cm"> * @param row {HTMLElement | Number} TR element reference or Datatable page row index.</span>
<span class="cm"> * @return {Boolean} Returns true if successful, else returns false.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_deleteTrEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">rowIndex</span><span class="p">;</span>

    <span class="c1">// Get page row index for the element</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">rowIndex</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">row</span><span class="p">).</span><span class="nx">sectionRowIndex</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">rowIndex</span> <span class="o">=</span> <span class="nx">row</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">rowIndex</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">rowIndex</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">rowIndex</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Cannot use tbody.deleteRow due to IE6 instability</span>
        <span class="c1">//return this._elTbody.deleteRow(rowIndex);</span>
        <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">[</span><span class="nx">row</span><span class="p">]);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>



























<span class="c1">// CSS/STATE FUNCTIONS</span>




<span class="cm">/**</span>
<span class="cm"> * Removes the class YAHOO.widget.DataTable.CLASS_FIRST from the first TR element</span>
<span class="cm"> * of the DataTable page and updates internal tracker.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _unsetFirstRow</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_unsetFirstRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Remove FIRST</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_sFirstTrId</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_sFirstTrId</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_FIRST</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_sFirstTrId</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns the class YAHOO.widget.DataTable.CLASS_FIRST to the first TR element</span>
<span class="cm"> * of the DataTable page and updates internal tracker.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _setFirstRow</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_setFirstRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_unsetFirstRow</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">elTr</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getFirstTrEl</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTr</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Set FIRST</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTr</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_FIRST</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_sFirstTrId</span> <span class="o">=</span> <span class="nx">elTr</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Removes the class YAHOO.widget.DataTable.CLASS_LAST from the last TR element</span>
<span class="cm"> * of the DataTable page and updates internal tracker.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _unsetLastRow</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_unsetLastRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Unassign previous class</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_sLastTrId</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_sLastTrId</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LAST</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_sLastTrId</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>   
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns the class YAHOO.widget.DataTable.CLASS_LAST to the last TR element</span>
<span class="cm"> * of the DataTable page and updates internal tracker.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _setLastRow</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_setLastRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_unsetLastRow</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">elTr</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getLastTrEl</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTr</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Assign class</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTr</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LAST</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_sLastTrId</span> <span class="o">=</span> <span class="nx">elTr</span><span class="p">.</span><span class="nx">id</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns the classes DT.CLASS_EVEN and DT.CLASS_ODD to one, many, or all TR elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _setRowStripes</span>
<span class="cm"> * @param row {HTMLElement | String | Number} (optional) HTML TR element reference</span>
<span class="cm"> * or string ID, or page row index of where to start striping.</span>
<span class="cm"> * @param range {Number} (optional) If given, how many rows to stripe, otherwise</span>
<span class="cm"> * stripe all the rows until the end.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_setRowStripes</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">,</span> <span class="nx">range</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Default values stripe all rows</span>
    <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">,</span>
        <span class="nx">nStartIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
        <span class="nx">nEndIndex</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
        <span class="nx">aOdds</span> <span class="o">=</span> <span class="p">[],</span> <span class="nx">nOddIdx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span>
        <span class="nx">aEvens</span> <span class="o">=</span> <span class="p">[],</span> <span class="nx">nEvenIdx</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>

    <span class="c1">// Stripe a subset</span>
    <span class="k">if</span><span class="p">((</span><span class="nx">row</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">row</span> <span class="o">!==</span> <span class="kc">undefined</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Validate given start row</span>
        <span class="kd">var</span> <span class="nx">elStartRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elStartRow</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">nStartIndex</span> <span class="o">=</span> <span class="nx">elStartRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span><span class="p">;</span>

            <span class="c1">// Validate given range</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">range</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">range</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">nEndIndex</span> <span class="o">=</span> <span class="nx">nStartIndex</span> <span class="o">+</span> <span class="nx">range</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="nx">nStartIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nEndIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">i</span><span class="o">%</span><span class="mi">2</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">aOdds</span><span class="p">[</span><span class="nx">nOddIdx</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
            <span class="nx">aEvens</span><span class="p">[</span><span class="nx">nEvenIdx</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">if</span> <span class="p">(</span><span class="nx">aOdds</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">replaceClass</span><span class="p">(</span><span class="nx">aOdds</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_EVEN</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ODD</span><span class="p">);</span>
    <span class="p">}</span>

    <span class="k">if</span> <span class="p">(</span><span class="nx">aEvens</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">replaceClass</span><span class="p">(</span><span class="nx">aEvens</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ODD</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_EVEN</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns the class DT.CLASS_SELECTED to TR and TD elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _setSelections</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_setSelections</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Keep track of selected rows</span>
    <span class="kd">var</span> <span class="nx">allSelectedRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getSelectedRows</span><span class="p">();</span>
    <span class="c1">// Keep track of selected cells</span>
    <span class="kd">var</span> <span class="nx">allSelectedCells</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getSelectedCells</span><span class="p">();</span>
    <span class="c1">// Anything to select?</span>
    <span class="k">if</span><span class="p">((</span><span class="nx">allSelectedRows</span><span class="p">.</span><span class="nx">length</span><span class="o">&gt;</span><span class="mi">0</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">allSelectedCells</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oColumnSet</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">,</span>
            <span class="nx">el</span><span class="p">;</span>
        <span class="c1">// Loop over each row</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">allSelectedRows</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">allSelectedRows</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Loop over each cell</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">allSelectedCells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">allSelectedCells</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">recordId</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">allSelectedCells</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">columnKey</span><span class="p">).</span><span class="nx">getKeyIndex</span><span class="p">()],</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>       
<span class="p">},</span>











































<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Private DOM Event Handlers</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

<span class="cm">/**</span>
<span class="cm"> * Validates minWidths whenever the render chain ends.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onRenderChainEnd</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onRenderChainEnd</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Hide loading message</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">hideTableMessage</span><span class="p">();</span>
    
    <span class="c1">// Show empty message</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_EMPTY&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_EMPTY</span><span class="p">);</span>        
    <span class="p">}</span>

    <span class="c1">// Execute in timeout thread to give implementers a chance</span>
    <span class="c1">// to subscribe after the constructor</span>
    <span class="kd">var</span> <span class="nx">oSelf</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
    <span class="nx">setTimeout</span><span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">((</span><span class="nx">oSelf</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>        
            <span class="c1">// Init event</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_bInit</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_bInit</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;initEvent&quot;</span><span class="p">);</span>
            <span class="p">}</span>
    
            <span class="c1">// Render event</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;renderEvent&quot;</span><span class="p">);</span>
            <span class="c1">// Backward compatibility</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;refreshEvent&quot;</span><span class="p">);</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable rendered&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    
            <span class="c1">// Post-render routine</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">validateColumnWidths</span><span class="p">();</span>
    
            <span class="c1">// Post-render event</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;postRenderEvent&quot;</span><span class="p">);</span>
            
            <span class="cm">/*if(YAHOO.example.Performance.trialStart) {</span>
<span class="cm">                YAHOO.log((new Date()).getTime() - YAHOO.example.Performance.trialStart.getTime() + &quot; ms&quot;, &quot;time&quot;);</span>
<span class="cm">                YAHOO.example.Performance.trialStart = null;</span>
<span class="cm">            }*/</span>
            
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Post-render routine executed&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
    <span class="p">},</span> <span class="mi">0</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles click events on the DOCUMENT.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onDocumentClick</span>
<span class="cm"> * @param e {HTMLEvent} The click event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onDocumentClick</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>

    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">isAncestor</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">,</span> <span class="nx">elTarget</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableBlurEvent&quot;</span><span class="p">);</span>

        <span class="c1">// Fires editorBlurEvent when click is not within the TABLE.</span>
        <span class="c1">// For cases when click is within the TABLE, due to timing issues,</span>
        <span class="c1">// the editorBlurEvent needs to get fired by the lower-level DOM click</span>
        <span class="c1">// handlers below rather than by the TABLE click handler directly.</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">getContainerEl</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">elContainer</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">getContainerEl</span><span class="p">();</span>
                <span class="c1">// Only if the click was not within the CellEditor container</span>
                <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">isAncestor</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span> <span class="nx">elTarget</span><span class="p">)</span> <span class="o">&amp;&amp;</span>
                        <span class="p">(</span><span class="nx">elContainer</span><span class="p">.</span><span class="nx">id</span> <span class="o">!==</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">id</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;blurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Backward Compatibility</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">isActive</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Only if the click was not within the Cell Editor container</span>
                <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">isAncestor</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">container</span><span class="p">,</span> <span class="nx">elTarget</span><span class="p">)</span> <span class="o">&amp;&amp;</span>
                        <span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">container</span><span class="p">.</span><span class="nx">id</span> <span class="o">!==</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">id</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorBlurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles focus events on the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTableFocus</span>
<span class="cm"> * @param e {HTMLEvent} The focus event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTableFocus</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableFocusEvent&quot;</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles focus events on the THEAD element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTheadFocus</span>
<span class="cm"> * @param e {HTMLEvent} The focus event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTheadFocus</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadFocusEvent&quot;</span><span class="p">);</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableFocusEvent&quot;</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles focus events on the TBODY element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTbodyFocus</span>
<span class="cm"> * @param e {HTMLEvent} The focus event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTbodyFocus</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tbodyFocusEvent&quot;</span><span class="p">);</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableFocusEvent&quot;</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles mouseover events on the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTableMouseover</span>
<span class="cm"> * @param e {HTMLEvent} The mouseover event.</span>
<span class="cm"> * @param origTarget {HTMLElement} The mouseenter delegated element.</span>
<span class="cm"> * @param container {HTMLElement} The mouseenter delegation container.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTableMouseover</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">origTarget</span><span class="p">,</span> <span class="nx">container</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">origTarget</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                 <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;a&quot;</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;td&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;span&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadLabelMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerLabelMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;th&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadCellMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="c1">// Backward compatibility</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerCellMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tr&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;thead&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadRowMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerRowMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableMouseoverEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles mouseout events on the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTableMouseout</span>
<span class="cm"> * @param e {HTMLEvent} The mouseout event.</span>
<span class="cm"> * @param origTarget {HTMLElement} The mouseleave delegated element.</span>
<span class="cm"> * @param container {HTMLElement} The mouseleave delegation container.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTableMouseout</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">origTarget</span><span class="p">,</span> <span class="nx">container</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">origTarget</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;a&quot;</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;td&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;span&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadLabelMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerLabelMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;th&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadCellMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="c1">// Backward compatibility</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerCellMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tr&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;thead&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadRowMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerRowMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableMouseoutEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles mousedown events on the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTableMousedown</span>
<span class="cm"> * @param e {HTMLEvent} The mousedown event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTableMousedown</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;a&quot;</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;td&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;span&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadLabelMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerLabelMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;th&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadCellMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="c1">// Backward compatibility</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerCellMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tr&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;thead&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadRowMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerRowMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableMousedownEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles mouseup events on the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTableMouseup</span>
<span class="cm"> * @param e {HTMLEvent} The mouseup event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTableMouseup</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;a&quot;</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;td&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;span&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadLabelMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerLabelMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;th&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadCellMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="c1">// Backward compatibility</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerCellMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tr&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;thead&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadRowMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerRowMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableMouseupEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles dblclick events on the DataTable instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTableDblclick</span>
<span class="cm"> * @param e {HTMLEvent} The dblclick event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTableDblclick</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;td&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;span&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadLabelDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerLabelDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;th&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadCellDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="c1">// Backward compatibility</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerCellDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tr&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">==</span> <span class="s2">&quot;thead&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadRowDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerRowDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableDblclickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>
<span class="cm">/**</span>
<span class="cm"> * Handles keydown events on the THEAD element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTheadKeydown</span>
<span class="cm"> * @param e {HTMLEvent} The key event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTheadKeydown</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;input&quot;</span><span class="o">:</span>
            <span class="k">case</span> <span class="s2">&quot;textarea&quot;</span><span class="o">:</span>
                <span class="c1">// TODO: implement textareaKeyEvent</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;thead&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadKeyEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableKeyEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles keydown events on the TBODY element. Handles selection behavior,</span>
<span class="cm"> * provides hooks for ENTER to edit functionality.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTbodyKeydown</span>
<span class="cm"> * @param e {HTMLEvent} The key event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTbodyKeydown</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sMode</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;selectionMode&quot;</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;standard&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_handleStandardSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;single&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_handleSingleSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellblock&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_handleCellBlockSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellrange&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_handleCellRangeSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;singlecell&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_handleSingleCellSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="p">}</span>
    
    <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;blurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">isActive</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorBlurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
    <span class="kd">var</span> <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tbody&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tbodyKeyEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableKeyEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles click events on the THEAD element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTheadClick</span>
<span class="cm"> * @param e {HTMLEvent} The click event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTheadClick</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// This blurs the CellEditor</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;blurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
        <span class="p">}</span>
        <span class="c1">// Backward compatibility</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">isActive</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorBlurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">),</span>
        <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">(),</span>
        <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;input&quot;</span><span class="o">:</span>
                <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">type</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadCheckboxClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadRadioClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">((</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;button&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;image&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;reset&quot;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadButtonClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">disabled</span><span class="p">){</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;a&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadLinkClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;button&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadButtonClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;span&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LABEL</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadLabelClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="c1">// Backward compatibility</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerLabelClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;th&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadCellClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="c1">// Backward compatibility</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerCellClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tr&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;theadRowClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="c1">// Backward compatibility</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;headerRowClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles click events on the primary TBODY element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onTbodyClick</span>
<span class="cm"> * @param e {HTMLEvent} The click event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onTbodyClick</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// This blurs the CellEditor</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;blurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">isActive</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorBlurEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="c1">// Fire Custom Events</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">),</span>
        <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span> <span class="o">&amp;&amp;</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">(),</span>
        <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elTag</span> <span class="o">!=</span> <span class="s2">&quot;table&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">switch</span><span class="p">(</span><span class="nx">elTag</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">case</span> <span class="s2">&quot;body&quot;</span><span class="o">:</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;input&quot;</span><span class="o">:</span>
                <span class="kd">var</span> <span class="nx">sType</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">type</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;checkbox&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;checkboxClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;radio&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;radioClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">((</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;button&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;image&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;submit&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sType</span> <span class="o">==</span> <span class="s2">&quot;reset&quot;</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;buttonClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">disabled</span><span class="p">){</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;a&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;linkClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;button&quot;</span><span class="o">:</span>
                <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">elTarget</span><span class="p">.</span><span class="nx">disabled</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;buttonClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;td&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">case</span> <span class="s2">&quot;tr&quot;</span><span class="o">:</span>
                <span class="nx">bKeepBubbling</span> <span class="o">=</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">,</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                <span class="k">break</span><span class="p">;</span>
            <span class="k">default</span><span class="o">:</span>
                <span class="k">break</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bKeepBubbling</span> <span class="o">===</span> <span class="kc">false</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elTag</span> <span class="o">=</span> <span class="nx">elTarget</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableClickEvent&quot;</span><span class="p">,{</span><span class="nx">target</span><span class="o">:</span><span class="p">(</span><span class="nx">elTarget</span> <span class="o">||</span> <span class="nx">oSelf</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">),</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Handles change events on SELECT elements within DataTable.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onDropdownChange</span>
<span class="cm"> * @param e {HTMLEvent} The change event.</span>
<span class="cm"> * @param oSelf {YAHOO.wiget.DataTable} DataTable instance.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_onDropdownChange</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getTarget</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;dropdownChangeEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">,</span> <span class="nx">target</span><span class="o">:</span><span class="nx">elTarget</span><span class="p">});</span>
<span class="p">},</span>
































<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Public member variables</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="cm">/**</span>
<span class="cm"> * Returns object literal of initial configs.</span>
<span class="cm"> *</span>
<span class="cm"> * @property configs</span>
<span class="cm"> * @type Object</span>
<span class="cm"> * @default {} </span>
<span class="cm"> */</span>
<span class="nx">configs</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>


<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Public methods</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

<span class="cm">/**</span>
<span class="cm"> * Returns unique id assigned to instance, which is a useful prefix for</span>
<span class="cm"> * generating unique DOM ID strings.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getId</span>
<span class="cm"> * @return {String} Unique ID of the DataSource instance.</span>
<span class="cm"> */</span>
<span class="nx">getId</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * DataSource instance name, for logging.</span>
<span class="cm"> *</span>
<span class="cm"> * @method toString</span>
<span class="cm"> * @return {String} Unique name of the DataSource instance.</span>
<span class="cm"> */</span>

<span class="nx">toString</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="s2">&quot;DataTable instance &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns the DataTable instance&#39;s DataSource instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getDataSource</span>
<span class="cm"> * @return {YAHOO.util.DataSource} DataSource instance.</span>
<span class="cm"> */</span>
<span class="nx">getDataSource</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns the DataTable instance&#39;s ColumnSet instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getColumnSet</span>
<span class="cm"> * @return {YAHOO.widget.ColumnSet} ColumnSet instance.</span>
<span class="cm"> */</span>
<span class="nx">getColumnSet</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns the DataTable instance&#39;s RecordSet instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getRecordSet</span>
<span class="cm"> * @return {YAHOO.widget.RecordSet} RecordSet instance.</span>
<span class="cm"> */</span>
<span class="nx">getRecordSet</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns on object literal representing the DataTable instance&#39;s current</span>
<span class="cm"> * state with the following properties:</span>
<span class="cm"> * &lt;dl&gt;</span>
<span class="cm"> * &lt;dt&gt;pagination&lt;/dt&gt;</span>
<span class="cm"> * &lt;dd&gt;Instance of YAHOO.widget.Paginator&lt;/dd&gt;</span>
<span class="cm"> *</span>
<span class="cm"> * &lt;dt&gt;sortedBy&lt;/dt&gt;</span>
<span class="cm"> * &lt;dd&gt;</span>
<span class="cm"> *     &lt;dl&gt;</span>
<span class="cm"> *         &lt;dt&gt;sortedBy.key&lt;/dt&gt;</span>
<span class="cm"> *         &lt;dd&gt;{String} Key of sorted Column&lt;/dd&gt;</span>
<span class="cm"> *         &lt;dt&gt;sortedBy.dir&lt;/dt&gt;</span>
<span class="cm"> *         &lt;dd&gt;{String} Initial sort direction, either YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC&lt;/dd&gt;</span>
<span class="cm"> *     &lt;/dl&gt;</span>
<span class="cm"> * &lt;/dd&gt;</span>
<span class="cm"> *</span>
<span class="cm"> * &lt;dt&gt;selectedRows&lt;/dt&gt;</span>
<span class="cm"> * &lt;dd&gt;Array of selected rows by Record ID.&lt;/dd&gt;</span>
<span class="cm"> *</span>
<span class="cm"> * &lt;dt&gt;selectedCells&lt;/dt&gt;</span>
<span class="cm"> * &lt;dd&gt;Selected cells as an array of object literals:</span>
<span class="cm"> *     {recordId:sRecordId, columnKey:sColumnKey}&lt;/dd&gt;</span>
<span class="cm"> * &lt;/dl&gt;</span>
<span class="cm"> *  </span>
<span class="cm"> * @method getState</span>
<span class="cm"> * @return {Object} DataTable instance state object literal values.</span>
<span class="cm"> */</span>
<span class="nx">getState</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="p">{</span>
        <span class="nx">totalRecords</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">).</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;totalRecords&quot;</span><span class="p">)</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getLength</span><span class="p">(),</span>
        <span class="nx">pagination</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;paginator&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;paginator&quot;</span><span class="p">).</span><span class="nx">getState</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
        <span class="nx">sortedBy</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">),</span>
        <span class="nx">selectedRows</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getSelectedRows</span><span class="p">(),</span>
        <span class="nx">selectedCells</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getSelectedCells</span><span class="p">()</span>
    <span class="p">};</span>
<span class="p">},</span>











































<span class="c1">// DOM ACCESSORS</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the DataTable&#39;s container element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getContainerEl</span>
<span class="cm"> * @return {HTMLElement} Reference to DIV element.</span>
<span class="cm"> */</span>
<span class="nx">getContainerEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the DataTable&#39;s TABLE element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getTableEl</span>
<span class="cm"> * @return {HTMLElement} Reference to TABLE element.</span>
<span class="cm"> */</span>
<span class="nx">getTableEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the DataTable&#39;s THEAD element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getTheadEl</span>
<span class="cm"> * @return {HTMLElement} Reference to THEAD element.</span>
<span class="cm"> */</span>
<span class="nx">getTheadEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the DataTable&#39;s primary TBODY element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getTbodyEl</span>
<span class="cm"> * @return {HTMLElement} Reference to TBODY element.</span>
<span class="cm"> */</span>
<span class="nx">getTbodyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the DataTable&#39;s secondary TBODY element that is</span>
<span class="cm"> * used to display messages.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getMsgTbodyEl</span>
<span class="cm"> * @return {HTMLElement} Reference to TBODY element.</span>
<span class="cm"> */</span>
<span class="nx">getMsgTbodyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the TD element within the secondary TBODY that is</span>
<span class="cm"> * used to display messages.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getMsgTdEl</span>
<span class="cm"> * @return {HTMLElement} Reference to TD element.</span>
<span class="cm"> */</span>
<span class="nx">getMsgTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTd</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns the corresponding TR reference for a given DOM element, ID string or</span>
<span class="cm"> * page row index. If the given identifier is a child of a TR element,</span>
<span class="cm"> * then DOM tree is traversed until a parent TR element is returned, otherwise</span>
<span class="cm"> * null. Returns null if the row is not considered a primary row (i.e., row</span>
<span class="cm"> * extensions).</span>
<span class="cm"> *</span>
<span class="cm"> * @method getTrEl</span>
<span class="cm"> * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Which row to</span>
<span class="cm"> * get: by element reference, ID string, page row index, or Record.</span>
<span class="cm"> * @return {HTMLElement} Reference to TR element, or null.</span>
<span class="cm"> */</span>
<span class="nx">getTrEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// By Record</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">row</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="nx">row</span><span class="p">.</span><span class="nx">getId</span><span class="p">());</span>
    <span class="p">}</span>
    <span class="c1">// By page row index</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">dataRows</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_REC</span><span class="p">,</span> <span class="s2">&quot;tr&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">);</span>
        <span class="k">return</span> <span class="nx">dataRows</span> <span class="o">&amp;&amp;</span> <span class="nx">dataRows</span><span class="p">[</span><span class="nx">row</span><span class="p">]</span> <span class="o">?</span> <span class="nx">dataRows</span><span class="p">[</span><span class="nx">row</span><span class="p">]</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// By ID string or element reference</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="o">?</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementById</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="o">:</span> <span class="nx">row</span><span class="p">;</span>

        <span class="c1">// Validate HTML element</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">ownerDocument</span> <span class="o">==</span> <span class="nb">document</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Validate TR element</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">!=</span> <span class="s2">&quot;tr&quot;</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Traverse up the DOM to find the corresponding TR element</span>
                <span class="nx">elRow</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getAncestorByTagName</span><span class="p">(</span><span class="nx">elRow</span><span class="p">,</span><span class="s2">&quot;tr&quot;</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="k">return</span> <span class="nx">elRow</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the first primary TR element in the DataTable page, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getFirstTrEl</span>
<span class="cm"> * @return {HTMLElement} Reference to TR element.</span>
<span class="cm"> */</span>
<span class="nx">getFirstTrEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">,</span>
        <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">]))</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
        <span class="p">}</span>
        <span class="nx">i</span><span class="o">++</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>

<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the last primary TR element in the DataTable page, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getLastTrEl</span>
<span class="cm"> * @return {HTMLElement} Reference to last TR element.</span>
<span class="cm"> */</span>
<span class="nx">getLastTrEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">,</span>
        <span class="nx">i</span><span class="o">=</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span>
    <span class="k">while</span><span class="p">(</span><span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">]))</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
        <span class="p">}</span>
        <span class="nx">i</span><span class="o">--</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the next TR element from the given primary TR element, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getNextTrEl</span>
<span class="cm"> * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Element</span>
<span class="cm"> * reference, ID string, page row index, or Record from which to get next TR element.</span>
<span class="cm"> * @param forcePrimary {Boolean} (optional) If true, will only return TR elements</span>
<span class="cm"> * that correspond to Records. Non-primary rows (such as row expansions)</span>
<span class="cm"> * will be skipped.</span>
<span class="cm"> * @return {HTMLElement} Reference to next TR element.</span>
<span class="cm"> */</span>
<span class="nx">getNextTrEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">,</span> <span class="nx">forcePrimary</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nThisTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">nThisTrIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">forcePrimary</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">while</span><span class="p">(</span><span class="nx">nThisTrIndex</span> <span class="o">&lt;</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">row</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">nThisTrIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="nx">row</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="nx">nThisTrIndex</span><span class="o">++</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">nThisTrIndex</span> <span class="o">&lt;</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">nThisTrIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get next TR element for row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the previous TR element from the given primary TR element, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getPreviousTrEl</span>
<span class="cm"> * @param row {HTMLElement | String | Number | YAHOO.widget.Record} Element</span>
<span class="cm"> * reference, ID string, page row index, or Record from which to get previous TR element.</span>
<span class="cm"> * @param forcePrimary {Boolean} (optional) If true, will only return TR elements</span>
<span class="cm"> * from rothat correspond to Records. Non-primary rows (such as row expansions)</span>
<span class="cm"> * will be skipped.</span>
<span class="cm"> * @return {HTMLElement} Reference to previous TR element.</span>
<span class="cm"> */</span>
<span class="nx">getPreviousTrEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">,</span> <span class="nx">forcePrimary</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nThisTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">nThisTrIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">;</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">forcePrimary</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">while</span><span class="p">(</span><span class="nx">nThisTrIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">row</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">nThisTrIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="nx">row</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="nx">nThisTrIndex</span><span class="o">--</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">nThisTrIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">nThisTrIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get previous TR element for row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>


<span class="cm">/**</span>
<span class="cm"> * Workaround for IE bug where hidden or not-in-dom elements cause cellIndex</span>
<span class="cm"> * value to be incorrect.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getCellIndex</span>
<span class="cm"> * @param cell {HTMLElement | Object} TD element or child of a TD element, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn}.</span>
<span class="cm"> * @return {Number} TD.cellIndex value.</span>
<span class="cm"> */</span>
<span class="nx">getCellIndex</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">cell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ua</span><span class="p">.</span><span class="nx">ie</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
                <span class="nx">tr</span> <span class="o">=</span> <span class="nx">cell</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">,</span>
                <span class="nx">allCells</span> <span class="o">=</span> <span class="nx">tr</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">,</span>
                <span class="nx">len</span> <span class="o">=</span> <span class="nx">allCells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
            <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">allCells</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">==</span> <span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="nx">i</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">cell</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to a TD liner element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getTdLinerEl</span>
<span class="cm"> * @param cell {HTMLElement | Object} TD element or child of a TD element, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn}.</span>
<span class="cm"> * @return {HTMLElement} Reference to TD liner element.</span>
<span class="cm"> */</span>
<span class="nx">getTdLinerEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>
    <span class="k">return</span> <span class="nx">elCell</span><span class="p">.</span><span class="nx">firstChild</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to a TD element. Returns null if the row is not</span>
<span class="cm"> * considered a primary row (i.e., row extensions).</span>
<span class="cm"> *</span>
<span class="cm"> * @method getTdEl</span>
<span class="cm"> * @param cell {HTMLElement | String | Object} TD element or child of a TD element, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn}.</span>
<span class="cm"> * @return {HTMLElement} Reference to TD element.</span>
<span class="cm"> */</span>
<span class="nx">getTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>

    <span class="c1">// Validate HTML element</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">ownerDocument</span> <span class="o">==</span> <span class="nb">document</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Validate TD element</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">!=</span> <span class="s2">&quot;td&quot;</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Traverse up the DOM to find the corresponding TR element</span>
            <span class="nx">elCell</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getAncestorByTagName</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span> <span class="s2">&quot;td&quot;</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elCell</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
        <span class="p">}</span>
        
        <span class="c1">// Make sure the TD is in this TBODY or is not in DOM</span>
        <span class="c1">// Bug 2527707 and bug 2263558</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span> <span class="o">&amp;&amp;</span> <span class="p">((</span><span class="nx">elCell</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span> <span class="o">==</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">)</span> <span class="o">||</span>
            <span class="p">(</span><span class="nx">elCell</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="o">||</span>
            <span class="p">(</span><span class="nx">elCell</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">nodeType</span> <span class="o">===</span> <span class="mi">11</span><span class="p">)))</span> <span class="p">{</span>
            <span class="c1">// Now we can return the TD element</span>
            <span class="k">return</span> <span class="nx">elCell</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">nColKeyIndex</span><span class="p">;</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">cell</span><span class="p">.</span><span class="nx">columnKey</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">cell</span><span class="p">.</span><span class="nx">recordId</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">cell</span><span class="p">.</span><span class="nx">recordId</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">cell</span><span class="p">.</span><span class="nx">columnKey</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">nColKeyIndex</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
            <span class="p">}</span>

        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">cell</span><span class="p">.</span><span class="nx">record</span> <span class="o">&amp;&amp;</span> <span class="nx">cell</span><span class="p">.</span><span class="nx">column</span> <span class="o">&amp;&amp;</span> <span class="nx">cell</span><span class="p">.</span><span class="nx">column</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oRecord</span> <span class="o">=</span> <span class="nx">cell</span><span class="p">.</span><span class="nx">record</span><span class="p">;</span>
            <span class="nx">nColKeyIndex</span> <span class="o">=</span> <span class="nx">cell</span><span class="p">.</span><span class="nx">column</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">);</span>
        <span class="k">if</span><span class="p">((</span><span class="nx">nColKeyIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">nColKeyIndex</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the first primary TD element in the DataTable page (by default),</span>
<span class="cm"> * the first TD element of the optionally given row, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getFirstTdEl</span>
<span class="cm"> * @param row {HTMLElement} (optional) row from which to get first TD</span>
<span class="cm"> * @return {HTMLElement} Reference to TD element.</span>
<span class="cm"> */</span>
<span class="nx">getFirstTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getFirstTrEl</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get first TD element for row &quot;</span> <span class="o">+</span> <span class="nx">elRow</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the last primary TD element in the DataTable page (by default),</span>
<span class="cm"> * the first TD element of the optionally given row, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getLastTdEl</span>
<span class="cm"> * @param row {HTMLElement} (optional) row from which to get first TD</span>
<span class="cm"> * @return {HTMLElement} Reference to last TD element.</span>
<span class="cm"> */</span>
<span class="nx">getLastTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getLastTrEl</span><span class="p">();</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get last TD element for row &quot;</span> <span class="o">+</span> <span class="nx">elRow</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the next TD element from the given cell, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getNextTdEl</span>
<span class="cm"> * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn} from which to get next TD element.</span>
<span class="cm"> * @return {HTMLElement} Reference to next TD element, or null.</span>
<span class="cm"> */</span>
<span class="nx">getNextTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">nThisTdIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nThisTdIndex</span> <span class="o">&lt;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">nThisTdIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nThisTdIndex</span> <span class="o">&lt;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">nThisTdIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">elNextRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getNextTrEl</span><span class="p">(</span><span class="nx">elRow</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNextRow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">elNextRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get next TD element for cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the previous TD element from the given cell, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getPreviousTdEl</span>
<span class="cm"> * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn} from which to get previous TD element.</span>
<span class="cm"> * @return {HTMLElement} Reference to previous TD element, or null.</span>
<span class="cm"> */</span>
<span class="nx">getPreviousTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">nThisTdIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nThisTdIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">nThisTdIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span> <span class="o">&amp;&amp;</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">elRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">nThisTdIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">elPreviousRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTrEl</span><span class="p">(</span><span class="nx">elRow</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elPreviousRow</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">getLastTdEl</span><span class="p">(</span><span class="nx">elPreviousRow</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get next TD element for cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the above TD element from the given cell, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getAboveTdEl</span>
<span class="cm"> * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn} from which to get next TD element.</span>
<span class="cm"> * @param forcePrimary {Boolean} (optional) If true, will only return TD elements</span>
<span class="cm"> * from rows that correspond to Records. Non-primary rows (such as row expansions)</span>
<span class="cm"> * will be skipped.</span>
<span class="cm"> * @return {HTMLElement} Reference to above TD element, or null.</span>
<span class="cm"> */</span>
<span class="nx">getAboveTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">,</span> <span class="nx">forcePrimary</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elPreviousRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTrEl</span><span class="p">(</span><span class="nx">elCell</span><span class="p">,</span> <span class="nx">forcePrimary</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elPreviousRow</span> <span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">cellIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">cells</span> <span class="o">&amp;&amp;</span> <span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">?</span> <span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">childNodes</span> <span class="o">&amp;&amp;</span> <span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">?</span> <span class="nx">elPreviousRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get above TD element for cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to the below TD element from the given cell, or null.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getBelowTdEl</span>
<span class="cm"> * @param cell {HTMLElement | String | Object} DOM element reference or string ID, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn} from which to get previous TD element.</span>
<span class="cm"> * @param forcePrimary {Boolean} (optional) If true, will only return TD elements</span>
<span class="cm"> * from rows that correspond to Records. Non-primary rows (such as row expansions)</span>
<span class="cm"> * will be skipped.</span>
<span class="cm"> * @return {HTMLElement} Reference to below TD element, or null.</span>
<span class="cm"> */</span>
<span class="nx">getBelowTdEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">,</span> <span class="nx">forcePrimary</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elNextRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getNextTrEl</span><span class="p">(</span><span class="nx">elCell</span><span class="p">,</span> <span class="nx">forcePrimary</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elNextRow</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">cellIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNextRow</span><span class="p">.</span><span class="nx">cells</span> <span class="o">&amp;&amp;</span> <span class="nx">elNextRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">elNextRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">?</span> <span class="nx">elNextRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">elNextRow</span><span class="p">.</span><span class="nx">childNodes</span> <span class="o">&amp;&amp;</span> <span class="nx">elNextRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">elNextRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">?</span> <span class="nx">elNextRow</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">cellIndex</span><span class="p">]</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get below TD element for cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to a TH liner element. Needed to normalize for resizeable </span>
<span class="cm"> * Columns, which have an additional resizer liner DIV element between the TH</span>
<span class="cm"> * element and the liner DIV element. </span>
<span class="cm"> *</span>
<span class="cm"> * @method getThLinerEl</span>
<span class="cm"> * @param theadCell {YAHOO.widget.Column | HTMLElement | String} Column instance,</span>
<span class="cm"> * DOM element reference, or string ID.</span>
<span class="cm"> * @return {HTMLElement} Reference to TH liner element.</span>
<span class="cm"> */</span>
<span class="nx">getThLinerEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">theadCell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">theadCell</span><span class="p">);</span>
    <span class="k">return</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThLinerEl</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns DOM reference to a TH element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getThEl</span>
<span class="cm"> * @param theadCell {YAHOO.widget.Column | HTMLElement | String} Column instance,</span>
<span class="cm"> * DOM element reference, or string ID.</span>
<span class="cm"> * @return {HTMLElement} Reference to TH element.</span>
<span class="cm"> */</span>
<span class="nx">getThEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">theadCell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTh</span><span class="p">;</span>

    <span class="c1">// Validate Column instance</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">theadCell</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">theadCell</span><span class="p">;</span>
        <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elTh</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">elTh</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="c1">// Validate HTML element</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">theadCell</span><span class="p">);</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">el</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">ownerDocument</span> <span class="o">==</span> <span class="nb">document</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// Validate TH element</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">el</span><span class="p">.</span><span class="nx">nodeName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">()</span> <span class="o">!=</span> <span class="s2">&quot;th&quot;</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Traverse up the DOM to find the corresponding TR element</span>
                <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getAncestorByTagName</span><span class="p">(</span><span class="nx">el</span><span class="p">,</span><span class="s2">&quot;th&quot;</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">el</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">return</span> <span class="nx">elTh</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns the page row index of given primary row. Returns null if the row is not on the</span>
<span class="cm"> * current DataTable page, or if row is not considered a primary row (i.e., row</span>
<span class="cm"> * extensions).</span>
<span class="cm"> *</span>
<span class="cm"> * @method getTrIndex</span>
<span class="cm"> * @param row {HTMLElement | String | YAHOO.widget.Record | Number} DOM or ID</span>
<span class="cm"> * string reference to an element within the DataTable page, a Record instance,</span>
<span class="cm"> * or a Record&#39;s RecordSet index.</span>
<span class="cm"> * @return {Number} Page row index, or null if data row does not exist or is not on current page.</span>
<span class="cm"> */</span>
<span class="nx">getTrIndex</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">record</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">),</span>
        <span class="nx">index</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">record</span><span class="p">),</span>
        <span class="nx">tr</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">record</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">tr</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">record</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">tr</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">tr</span><span class="p">.</span><span class="nx">sectionRowIndex</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;paginator&quot;</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;recordOffset&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="nx">index</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">index</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get page row index for row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>














































<span class="c1">// TABLE FUNCTIONS</span>

<span class="cm">/**</span>
<span class="cm"> * Loads new data. Convenience method that calls DataSource&#39;s sendRequest()</span>
<span class="cm"> * method under the hood.</span>
<span class="cm"> *</span>
<span class="cm"> * @method load</span>
<span class="cm"> * @param oConfig {object} Optional configuration parameters:</span>
<span class="cm"> *</span>
<span class="cm"> * &lt;dl&gt;</span>
<span class="cm"> * &lt;dt&gt;request&lt;/dt&gt;&lt;dd&gt;Pass in a new request, or initialRequest is used.&lt;/dd&gt;</span>
<span class="cm"> * &lt;dt&gt;callback&lt;/dt&gt;&lt;dd&gt;Pass in DataSource sendRequest() callback object, or the following is used:</span>
<span class="cm"> *    &lt;dl&gt;</span>
<span class="cm"> *      &lt;dt&gt;success&lt;/dt&gt;&lt;dd&gt;datatable.onDataReturnInitializeTable&lt;/dd&gt;</span>
<span class="cm"> *      &lt;dt&gt;failure&lt;/dt&gt;&lt;dd&gt;datatable.onDataReturnInitializeTable&lt;/dd&gt;</span>
<span class="cm"> *      &lt;dt&gt;scope&lt;/dt&gt;&lt;dd&gt;datatable&lt;/dd&gt;</span>
<span class="cm"> *      &lt;dt&gt;argument&lt;/dt&gt;&lt;dd&gt;datatable.getState()&lt;/dd&gt;</span>
<span class="cm"> *    &lt;/dl&gt;</span>
<span class="cm"> * &lt;/dd&gt;</span>
<span class="cm"> * &lt;dt&gt;datasource&lt;/dt&gt;&lt;dd&gt;Pass in a new DataSource instance to override the current DataSource for this transaction.&lt;/dd&gt;</span>
<span class="cm"> * &lt;/dl&gt;</span>
<span class="cm"> */</span>
<span class="nx">load</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oConfig</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oConfig</span> <span class="o">=</span> <span class="nx">oConfig</span> <span class="o">||</span> <span class="p">{};</span>

    <span class="p">(</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">datasource</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">).</span><span class="nx">sendRequest</span><span class="p">(</span><span class="nx">oConfig</span><span class="p">.</span><span class="nx">request</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;initialRequest&quot;</span><span class="p">),</span> <span class="nx">oConfig</span><span class="p">.</span><span class="nx">callback</span> <span class="o">||</span> <span class="p">{</span>
        <span class="nx">success</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnInitializeTable</span><span class="p">,</span>
        <span class="nx">failure</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnInitializeTable</span><span class="p">,</span>
        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
        <span class="nx">argument</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getState</span><span class="p">()</span>
    <span class="p">});</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Resets a RecordSet with the given data and populates the page view</span>
<span class="cm"> * with the new data. Any previous data, and selection and sort states are</span>
<span class="cm"> * cleared. New data should be added as a separate step. </span>
<span class="cm"> *</span>
<span class="cm"> * @method initializeTable</span>
<span class="cm"> */</span>
<span class="nx">initializeTable</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Reset init flag</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_bInit</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    
    <span class="c1">// Clear the RecordSet</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">reset</span><span class="p">();</span>

    <span class="c1">// Clear the Paginator&#39;s totalRecords if paginating</span>
    <span class="kd">var</span> <span class="nx">pag</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">pag</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">pag</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">,</span><span class="mi">0</span><span class="p">);</span>
    <span class="p">}</span>

    <span class="c1">// Clear selections</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_unselectAllTrEls</span><span class="p">();</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_unselectAllTdEls</span><span class="p">();</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    
    <span class="c1">// Clear sort</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">,</span> <span class="kc">null</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Internal wrapper calls run() on render Chain instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _runRenderChain</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_runRenderChain</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">run</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns array of Records for current view. For example, if paginated, it</span>
<span class="cm"> * returns the subset of Records for current page.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _getViewRecords</span>
<span class="cm"> * @protected</span>
<span class="cm"> * @return {Array} Array of Records to display in current view.</span>
<span class="cm"> */</span>
<span class="nx">_getViewRecords</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Paginator is enabled, show a subset of Records</span>
    <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecords</span><span class="p">(</span>
                        <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getStartIndex</span><span class="p">(),</span>
                        <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getRowsPerPage</span><span class="p">());</span>
    <span class="p">}</span>
    <span class="c1">// Not paginated, show all records</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecords</span><span class="p">();</span>
    <span class="p">}</span>

<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Renders the view with existing Records from the RecordSet while</span>
<span class="cm"> * maintaining sort, pagination, and selection states. For performance, reuses</span>
<span class="cm"> * existing DOM elements when possible while deleting extraneous elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method render</span>
<span class="cm"> */</span>
<span class="nx">render</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
<span class="c1">//YAHOO.example.Performance.trialStart = new Date();</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">stop</span><span class="p">();</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;beforeRenderEvent&quot;</span><span class="p">);</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable rendering...&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>

    <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">j</span><span class="p">,</span> <span class="nx">k</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span>
        <span class="nx">allRecords</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getViewRecords</span><span class="p">();</span>


    <span class="c1">// From the top, update in-place existing rows, so as to reuse DOM elements</span>
    <span class="kd">var</span> <span class="nx">elTbody</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">,</span>
        <span class="nx">loopN</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">),</span>
        <span class="nx">nRecordsLength</span> <span class="o">=</span> <span class="nx">allRecords</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
    
    <span class="c1">// Table has rows</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">nRecordsLength</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>                
        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
        <span class="k">while</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">.</span><span class="nx">lastChild</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elTbody</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">.</span><span class="nx">lastChild</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>

        <span class="c1">// Set up the loop Chain to render rows</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
            <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRecord</span><span class="p">,</span>
                        <span class="nx">endRecordIndex</span> <span class="o">=</span> <span class="p">((</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRecord</span><span class="o">+</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">nLoopLength</span><span class="p">)</span> <span class="o">&gt;</span> <span class="nx">nRecordsLength</span><span class="p">)</span> <span class="o">?</span>
                                <span class="nx">nRecordsLength</span> <span class="o">:</span> <span class="p">(</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRecord</span><span class="o">+</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">nLoopLength</span><span class="p">),</span>
                        <span class="nx">elRow</span><span class="p">,</span> <span class="nx">nextSibling</span><span class="p">;</span>

                    <span class="nx">elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
                    
                    <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">endRecordIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">elRow</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">allRecords</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getId</span><span class="p">());</span>
                        <span class="nx">elRow</span> <span class="o">=</span> <span class="nx">elRow</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_addTrEl</span><span class="p">(</span><span class="nx">allRecords</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="nx">nextSibling</span> <span class="o">=</span> <span class="nx">elTbody</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
                        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">elRow</span><span class="p">,</span> <span class="nx">nextSibling</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="nx">elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
                    
                    <span class="c1">// Set up for the next loop</span>
                    <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRecord</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">},</span>
            <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">nRecordsLength</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
            <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span>
                <span class="nx">nCurrentRecord</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span><span class="c1">//nRecordsLength-1,  // Start at first Record</span>
                <span class="nx">nLoopLength</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nx">loopN</span> <span class="o">:</span> <span class="nx">nRecordsLength</span>
            <span class="p">},</span>
            <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
        <span class="p">});</span>
        
        <span class="c1">// Post-render tasks</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
            <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">while</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="nx">nRecordsLength</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">elTbody</span><span class="p">.</span><span class="nx">lastChild</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_setFirstRow</span><span class="p">();</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_setLastRow</span><span class="p">();</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_setRowStripes</span><span class="p">();</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_setSelections</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">},</span>
            <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
        <span class="p">});</span>
     
    <span class="p">}</span>
    <span class="c1">// Table has no rows</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="c1">// Set up the loop Chain to delete rows</span>
        <span class="kd">var</span> <span class="nx">nTotal</span> <span class="o">=</span> <span class="nx">elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nTotal</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrent</span><span class="p">,</span>
                            <span class="nx">loopN</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nLoopLength</span><span class="p">,</span>
                            <span class="nx">nIterEnd</span> <span class="o">=</span> <span class="p">(</span><span class="nx">i</span> <span class="o">-</span> <span class="nx">loopN</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="nx">i</span> <span class="o">-</span> <span class="nx">loopN</span><span class="p">;</span>
    
                        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
                        
                        <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span><span class="o">&gt;</span><span class="nx">nIterEnd</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elTbody</span><span class="p">.</span><span class="nx">deleteRow</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">);</span>
                        <span class="p">}</span>
                        <span class="nx">elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
                        
                        <span class="c1">// Set up for the next loop</span>
                        <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrent</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">},</span>
                <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">nTotal</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
                <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span>
                    <span class="nx">nCurrent</span><span class="o">:</span> <span class="nx">nTotal</span><span class="p">,</span> 
                    <span class="nx">nLoopLength</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nx">loopN</span> <span class="o">:</span> <span class="nx">nTotal</span>
                <span class="p">},</span>
                <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
            <span class="p">});</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Disables DataTable UI.</span>
<span class="cm"> *</span>
<span class="cm"> * @method disable</span>
<span class="cm"> */</span>
<span class="nx">disable</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">elTable</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTable</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">elMask</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elMask</span><span class="p">;</span>
    <span class="nx">elMask</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">elTable</span><span class="p">.</span><span class="nx">offsetWidth</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">;</span>
    <span class="nx">elMask</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">height</span> <span class="o">=</span> <span class="nx">elTable</span><span class="p">.</span><span class="nx">offsetHeight</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">;</span>
    <span class="nx">elMask</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">left</span> <span class="o">=</span> <span class="nx">elTable</span><span class="p">.</span><span class="nx">offsetLeft</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">;</span>
    <span class="nx">elMask</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;disableEvent&quot;</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Undisables DataTable UI.</span>
<span class="cm"> *</span>
<span class="cm"> * @method undisable</span>
<span class="cm"> */</span>
<span class="nx">undisable</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_elMask</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;undisableEvent&quot;</span><span class="p">);</span>
<span class="p">},</span>

 <span class="cm">/**</span>
<span class="cm"> * Returns disabled state.</span>
<span class="cm"> *</span>
<span class="cm"> * @method isDisabled</span>
<span class="cm"> * @return {Boolean} True if UI is disabled, otherwise false</span>
<span class="cm"> */</span>
<span class="nx">isDisabled</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_disabled</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Nulls out the entire DataTable instance and related objects, removes attached</span>
<span class="cm"> * event listeners, and clears out DOM elements inside the container. After</span>
<span class="cm"> * calling this method, the instance reference should be expliclitly nulled by</span>
<span class="cm"> * implementer, as in myDataTable = null. Use with caution!</span>
<span class="cm"> *</span>
<span class="cm"> * @method destroy</span>
<span class="cm"> */</span>
<span class="nx">destroy</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Store for later</span>
    <span class="kd">var</span> <span class="nx">instanceName</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">();</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">stop</span><span class="p">();</span>
    
    <span class="c1">// Destroy ColumnDD and ColumnResizers</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyColumnHelpers</span><span class="p">();</span>
    
    <span class="c1">// Destroy all CellEditors</span>
    <span class="kd">var</span> <span class="nx">oCellEditor</span><span class="p">;</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">flat</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oCellEditor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">flat</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">editor</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oCellEditor</span> <span class="o">&amp;&amp;</span> <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">destroy</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">flat</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">editor</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="c1">// Destroy Paginator</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyPaginator</span><span class="p">();</span>

    <span class="c1">// Unhook custom events</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">();</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">unsubscribeAll</span><span class="p">();</span>

    <span class="c1">// Unhook DOM events</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">removeListener</span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onDocumentClick</span><span class="p">);</span>
    
    <span class="c1">// Clear out the container</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyContainerEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">);</span>

    <span class="c1">// Null out objects</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">param</span> <span class="k">in</span> <span class="k">this</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">param</span><span class="p">))</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">[</span><span class="nx">param</span><span class="p">]</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    
    <span class="c1">// Clean up static values</span>
    <span class="nx">DT</span><span class="p">.</span><span class="nx">_nCurrentCount</span><span class="o">--</span><span class="p">;</span>
    
    <span class="k">if</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">_nCurrentCount</span> <span class="o">&lt;</span> <span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">_elDynStyleNode</span><span class="p">)</span> <span class="p">{</span>
            <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;head&#39;</span><span class="p">)[</span><span class="mi">0</span><span class="p">].</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">_elDynStyleNode</span><span class="p">);</span>
            <span class="nx">DT</span><span class="p">.</span><span class="nx">_elDynStyleNode</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable instance destroyed: &quot;</span> <span class="o">+</span> <span class="nx">instanceName</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Displays message within secondary TBODY.</span>
<span class="cm"> *</span>
<span class="cm"> * @method showTableMessage</span>
<span class="cm"> * @param sHTML {HTML} (optional) Value for innerHTML.</span>
<span class="cm"> * @param sClassName {String} (optional) Classname.</span>
<span class="cm"> */</span>
<span class="nx">showTableMessage</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sHTML</span><span class="p">,</span> <span class="nx">sClassName</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTd</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">sHTML</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">elCell</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">sHTML</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">sClassName</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">elCell</span><span class="p">.</span><span class="nx">className</span> <span class="o">=</span> <span class="nx">sClassName</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableMsgShowEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">html</span><span class="o">:</span><span class="nx">sHTML</span><span class="p">,</span> <span class="nx">className</span><span class="o">:</span><span class="nx">sClassName</span><span class="p">});</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable showing message: &quot;</span> <span class="o">+</span> <span class="nx">sHTML</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Hides secondary TBODY.</span>
<span class="cm"> *</span>
<span class="cm"> * @method hideTableMessage</span>
<span class="cm"> */</span>
<span class="nx">hideTableMessage</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">!=</span> <span class="s2">&quot;none&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elMsgTbody</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;tableMsgHideEvent&quot;</span><span class="p">);</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable message hidden&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Brings focus to the TBODY element. Alias to focusTbodyEl.</span>
<span class="cm"> *</span>
<span class="cm"> * @method focus</span>
<span class="cm"> */</span>
<span class="nx">focus</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">focusTbodyEl</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Brings focus to the THEAD element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method focusTheadEl</span>
<span class="cm"> */</span>
<span class="nx">focusTheadEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_focusEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Brings focus to the TBODY element.</span>
<span class="cm"> *</span>
<span class="cm"> * @method focusTbodyEl</span>
<span class="cm"> */</span>
<span class="nx">focusTbodyEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_focusEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Setting display:none on DataTable or any parent may impact width validations.</span>
<span class="cm"> * After setting display back to &quot;&quot;, implementers should call this method to </span>
<span class="cm"> * manually perform those validations.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onShow</span>
<span class="cm"> */</span>
<span class="nx">onShow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">validateColumnWidths</span><span class="p">();</span>
    
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">allKeys</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">,</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">col</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">col</span> <span class="o">=</span> <span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">col</span><span class="p">.</span><span class="nx">_ddResizer</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">col</span><span class="p">.</span><span class="nx">_ddResizer</span><span class="p">.</span><span class="nx">resetResizerEl</span><span class="p">();</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>



































































<span class="c1">// RECORDSET FUNCTIONS</span>

<span class="cm">/**</span>
<span class="cm"> * Returns Record index for given TR element or page row index.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getRecordIndex</span>
<span class="cm"> * @param row {YAHOO.widget.Record | HTMLElement | Number} Record instance, TR</span>
<span class="cm"> * element reference or page row index.</span>
<span class="cm"> * @return {Number} Record&#39;s RecordSet index, or null.</span>
<span class="cm"> */</span>
<span class="nx">getRecordIndex</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nTrIndex</span><span class="p">;</span>

    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// By Record</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">row</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// By element reference</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="c1">// Find the TR element</span>
            <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">nTrIndex</span> <span class="o">=</span> <span class="nx">el</span><span class="p">.</span><span class="nx">sectionRowIndex</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="c1">// By page row index</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">nTrIndex</span> <span class="o">=</span> <span class="nx">row</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">nTrIndex</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;paginator&quot;</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;recordOffset&#39;</span><span class="p">)</span> <span class="o">+</span> <span class="nx">nTrIndex</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">return</span> <span class="nx">nTrIndex</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get Record index for row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * For the given identifier, returns the associated Record instance.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getRecord</span>
<span class="cm"> * @param row {HTMLElement | Number | String} DOM reference to a TR element (or</span>
<span class="cm"> * child of a TR element), RecordSet position index, or Record ID.</span>
<span class="cm"> * @return {YAHOO.widget.Record} Record instance.</span>
<span class="cm"> */</span>
<span class="nx">getRecord</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Validate TR element</span>
        <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elRow</span><span class="p">.</span><span class="nx">id</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get Record for row at &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>














































<span class="c1">// COLUMN FUNCTIONS</span>

<span class="cm">/**</span>
<span class="cm"> * For the given identifier, returns the associated Column instance. Note: For</span>
<span class="cm"> * getting Columns by Column ID string, please use the method getColumnById().</span>
<span class="cm"> *</span>
<span class="cm"> * @method getColumn</span>
<span class="cm"> * @param column {HTMLElement | String | Number} TH/TD element (or child of a</span>
<span class="cm"> * TH/TD element), a Column key, or a ColumnSet key index.</span>
<span class="cm"> * @return {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> */</span>
<span class="nx">getColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">column</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">column</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Validate TD element</span>
        <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">column</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">));</span>
        <span class="p">}</span>
        <span class="c1">// Validate TH element</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">(</span><span class="nx">column</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Find by TH el ID</span>
                <span class="kd">var</span> <span class="nx">allColumns</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">flat</span><span class="p">;</span>
                <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allColumns</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">allColumns</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getThEl</span><span class="p">().</span><span class="nx">id</span> <span class="o">===</span> <span class="nx">elCell</span><span class="p">.</span><span class="nx">id</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">allColumns</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="p">}</span> 
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not get Column for column at &quot;</span> <span class="o">+</span> <span class="nx">column</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nx">oColumn</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * For the given Column ID, returns the associated Column instance. Note: For</span>
<span class="cm"> * getting Columns by key, please use the method getColumn().</span>
<span class="cm"> *</span>
<span class="cm"> * @method getColumnById</span>
<span class="cm"> * @param column {String} Column ID string.</span>
<span class="cm"> * @return {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> */</span>
<span class="nx">getColumnById</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">column</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getColumnById</span><span class="p">(</span><span class="nx">column</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * For the given Column instance, returns next direction to sort.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getColumnSortDir</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param oSortedBy {Object} (optional) Specify the state, or use current state. </span>
<span class="cm"> * @return {String} YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTableCLASS_DESC.</span>
<span class="cm"> */</span>
<span class="nx">getColumnSortDir</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oSortedBy</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">defaultDir</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">defaultDir</span> <span class="o">==</span> <span class="s2">&quot;asc&quot;</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">defaultDir</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">defaultDir</span> <span class="o">==</span> <span class="s2">&quot;desc&quot;</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">defaultDir</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    
    <span class="c1">// What is the Column&#39;s default sort direction?</span>
    <span class="kd">var</span> <span class="nx">sortDir</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">defaultDir</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">defaultDir</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">;</span>

    <span class="c1">// Is the Column currently sorted?</span>
    <span class="kd">var</span> <span class="nx">bSorted</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
    <span class="nx">oSortedBy</span> <span class="o">=</span> <span class="nx">oSortedBy</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oSortedBy</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">bSorted</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">dir</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">sortDir</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">dir</span> <span class="o">===</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">)</span> <span class="o">?</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">sortDir</span> <span class="o">=</span> <span class="p">(</span><span class="nx">sortDir</span> <span class="o">===</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">)</span> <span class="o">?</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span> <span class="o">:</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nx">sortDir</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Overridable method gives implementers a hook to show loading message before</span>
<span class="cm"> * sorting Column.</span>
<span class="cm"> *</span>
<span class="cm"> * @method doBeforeSortColumn</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param sSortDir {String} YAHOO.widget.DataTable.CLASS_ASC or</span>
<span class="cm"> * YAHOO.widget.DataTable.CLASS_DESC.</span>
<span class="cm"> * @return {Boolean} Return true to continue sorting Column.</span>
<span class="cm"> */</span>
<span class="nx">doBeforeSortColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sSortDir</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_LOADING&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LOADING</span><span class="p">);</span>
    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sorts given Column. If &quot;dynamicData&quot; is true, current selections are purged before</span>
<span class="cm"> * a request is sent to the DataSource for data for the new state (using the</span>
<span class="cm"> * request returned by &quot;generateRequest()&quot;).</span>
<span class="cm"> *</span>
<span class="cm"> * @method sortColumn</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param sDir {String} (Optional) YAHOO.widget.DataTable.CLASS_ASC or</span>
<span class="cm"> * YAHOO.widget.DataTable.CLASS_DESC</span>
<span class="cm"> */</span>
<span class="nx">sortColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sDir</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortable</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SORTABLE</span><span class="p">);</span>
        <span class="p">}</span>
        
        <span class="c1">// Validate given direction</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">sDir</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">sDir</span> <span class="o">!==</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ASC</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">sDir</span> <span class="o">!==</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">sDir</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>
        
        <span class="c1">// Get the sort dir</span>
        <span class="kd">var</span> <span class="nx">sSortDir</span> <span class="o">=</span> <span class="nx">sDir</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumnSortDir</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>

        <span class="c1">// Is the Column currently sorted?</span>
        <span class="kd">var</span> <span class="nx">oSortedBy</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">{};</span>
        <span class="kd">var</span> <span class="nx">bSorted</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oSortedBy</span><span class="p">.</span><span class="nx">key</span> <span class="o">===</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span><span class="p">)</span> <span class="o">?</span> <span class="kc">true</span> <span class="o">:</span> <span class="kc">false</span><span class="p">;</span>

        <span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeSortColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sSortDir</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ok</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Server-side sort</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;dynamicData&quot;</span><span class="p">))</span> <span class="p">{</span>
                <span class="c1">// Get current state</span>
                <span class="kd">var</span> <span class="nx">oState</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getState</span><span class="p">();</span>
                
                <span class="c1">// Reset record offset, if paginated</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oState</span><span class="p">.</span><span class="nx">pagination</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oState</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">recordOffset</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
                <span class="p">}</span>
                
                <span class="c1">// Update sortedBy to new values</span>
                <span class="nx">oState</span><span class="p">.</span><span class="nx">sortedBy</span> <span class="o">=</span> <span class="p">{</span>
                    <span class="nx">key</span><span class="o">:</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span><span class="p">,</span>
                    <span class="nx">dir</span><span class="o">:</span> <span class="nx">sSortDir</span>
                <span class="p">};</span>
                
                <span class="c1">// Get the request for the new state</span>
                <span class="kd">var</span> <span class="nx">request</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;generateRequest&quot;</span><span class="p">)(</span><span class="nx">oState</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>

                <span class="c1">// Purge selections</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllRows</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllCells</span><span class="p">();</span>

                <span class="c1">// Send request for new data</span>
                <span class="kd">var</span> <span class="nx">callback</span> <span class="o">=</span> <span class="p">{</span>
                    <span class="nx">success</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">,</span>
                    <span class="nx">failure</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">,</span>
                    <span class="nx">argument</span> <span class="o">:</span> <span class="nx">oState</span><span class="p">,</span> <span class="c1">// Pass along the new state to the callback</span>
                    <span class="nx">scope</span> <span class="o">:</span> <span class="k">this</span>
                <span class="p">};</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">.</span><span class="nx">sendRequest</span><span class="p">(</span><span class="nx">request</span><span class="p">,</span> <span class="nx">callback</span><span class="p">);</span>            
            <span class="p">}</span>
            <span class="c1">// Client-side sort</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Is there a custom sort handler function defined?</span>
                <span class="kd">var</span> <span class="nx">sortFnc</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">sortFunction</span><span class="p">))</span> <span class="o">?</span>
                        <span class="c1">// Custom sort function</span>
                        <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">sortFunction</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
                   
                <span class="c1">// Sort the Records</span>
                <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">bSorted</span> <span class="o">||</span> <span class="nx">sDir</span> <span class="o">||</span> <span class="nx">sortFnc</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Default sort function if necessary</span>
                    <span class="nx">sortFnc</span> <span class="o">=</span> <span class="nx">sortFnc</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;sortFunction&quot;</span><span class="p">);</span>
                    <span class="c1">// Get the field to sort</span>
                    <span class="kd">var</span> <span class="nx">sField</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">field</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortOptions</span><span class="p">.</span><span class="nx">field</span> <span class="o">:</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">field</span><span class="p">;</span>

                    <span class="c1">// Sort the Records        </span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">sortRecords</span><span class="p">(</span><span class="nx">sortFnc</span><span class="p">,</span> <span class="p">((</span><span class="nx">sSortDir</span> <span class="o">==</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DESC</span><span class="p">)</span> <span class="o">?</span> <span class="kc">true</span> <span class="o">:</span> <span class="kc">false</span><span class="p">),</span> <span class="nx">sField</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="c1">// Just reverse the Records</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">reverseRecords</span><span class="p">();</span>
                <span class="p">}</span>
        
                <span class="c1">// Reset to first page if paginated</span>
                <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Set page silently, so as not to fire change event.</span>
                    <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">setPage</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="kc">true</span><span class="p">);</span>
                <span class="p">}</span>
        
                <span class="c1">// Update UI via sortedBy</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s2">&quot;sortedBy&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">key</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span><span class="p">,</span> <span class="nx">dir</span><span class="o">:</span><span class="nx">sSortDir</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">});</span> 
            <span class="p">}</span>       
            
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnSortEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">,</span><span class="nx">dir</span><span class="o">:</span><span class="nx">sSortDir</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; sorted \&quot;&quot;</span> <span class="o">+</span> <span class="nx">sSortDir</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not sort Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sets given Column to given pixel width. If new width is less than minimum</span>
<span class="cm"> * width, sets to minimum width. Updates oColumn.width value.</span>
<span class="cm"> *</span>
<span class="cm"> * @method setColumnWidth</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param nWidth {Number} New width in pixels. A null value auto-sizes Column,</span>
<span class="cm"> * subject to minWidth and maxAutoWidth validations. </span>
<span class="cm"> */</span>
<span class="nx">setColumnWidth</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">nWidth</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Validate new width against minimum width</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">nWidth</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// This is why we must require a Number... :-|</span>
            <span class="nx">nWidth</span> <span class="o">=</span> <span class="p">(</span><span class="nx">nWidth</span> <span class="o">&gt;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span><span class="p">)</span> <span class="o">?</span> <span class="nx">nWidth</span> <span class="o">:</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span><span class="p">;</span>

            <span class="c1">// Save state</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">nWidth</span><span class="p">;</span>
            
            <span class="c1">// Resize the DOM elements</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidth</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">nWidth</span><span class="o">+</span><span class="s2">&quot;px&quot;</span><span class="p">);</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnSetWidthEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">,</span><span class="nx">width</span><span class="o">:</span><span class="nx">nWidth</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Set width of Column &quot;</span> <span class="o">+</span> <span class="nx">oColumn</span> <span class="o">+</span> <span class="s2">&quot; to &quot;</span> <span class="o">+</span> <span class="nx">nWidth</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
        <span class="c1">// Unsets a width to auto-size</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nWidth</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Save state</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">nWidth</span><span class="p">;</span>
            
            <span class="c1">// Resize the DOM elements</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidth</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="s2">&quot;auto&quot;</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">validateColumnWidths</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnUnsetWidthEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column &quot;</span> <span class="o">+</span> <span class="nx">oColumn</span> <span class="o">+</span> <span class="s2">&quot; width unset&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
                
        <span class="c1">// Bug 2339454: resize then sort misaligment</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_clearTrTemplateEl</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not set width of Column &quot;</span> <span class="o">+</span> <span class="nx">oColumn</span> <span class="o">+</span> <span class="s2">&quot; to &quot;</span> <span class="o">+</span> <span class="nx">nWidth</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sets liner DIV elements of given Column to given width. When value should be</span>
<span class="cm"> * auto-calculated to fit content overflow is set to visible, otherwise overflow</span>
<span class="cm"> * is set to hidden. No validations against minimum width and no updating</span>
<span class="cm"> * Column.width value.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _setColumnWidth</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param sWidth {String} New width value.</span>
<span class="cm"> * @param sOverflow {String} Should be &quot;hidden&quot; when Column width is explicitly</span>
<span class="cm"> * being set to a value, but should be &quot;visible&quot; when Column is meant to auto-fit content.  </span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_setColumnWidth</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sWidth</span><span class="p">,</span> <span class="nx">sOverflow</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">sOverflow</span> <span class="o">=</span> <span class="nx">sOverflow</span> <span class="o">||</span> <span class="p">(((</span><span class="nx">sWidth</span> <span class="o">===</span> <span class="s1">&#39;&#39;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sWidth</span> <span class="o">===</span> <span class="s1">&#39;auto&#39;</span><span class="p">))</span> <span class="o">?</span> <span class="s1">&#39;visible&#39;</span> <span class="o">:</span> <span class="s1">&#39;hidden&#39;</span><span class="p">);</span>
    
        <span class="c1">// Dynamic style algorithm</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">DT</span><span class="p">.</span><span class="nx">_bDynStylesFallback</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidthDynStyles</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sWidth</span><span class="p">,</span> <span class="nx">sOverflow</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// Dynamic function algorithm</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidthDynFunction</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sWidth</span><span class="p">,</span> <span class="nx">sOverflow</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not set width of unknown Column &quot;</span> <span class="o">+</span> <span class="nx">oColumn</span> <span class="o">+</span> <span class="s2">&quot; to &quot;</span> <span class="o">+</span> <span class="nx">sWidth</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Updates width of a Column&#39;s liner DIV elements by dynamically creating a</span>
<span class="cm"> * STYLE node and writing and updating CSS style rules to it. If this fails during</span>
<span class="cm"> * runtime, the fallback method _setColumnWidthDynFunction() will be called.</span>
<span class="cm"> * Notes: This technique is not performant in IE6. IE7 crashes if DataTable is</span>
<span class="cm"> * nested within another TABLE element. For these cases, it is recommended to</span>
<span class="cm"> * use the method _setColumnWidthDynFunction by setting _bDynStylesFallback to TRUE.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _setColumnWidthDynStyles</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param sWidth {String} New width value.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_setColumnWidthDynStyles</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sWidth</span><span class="p">,</span> <span class="nx">sOverflow</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">_elDynStyleNode</span><span class="p">,</span>
        <span class="nx">rule</span><span class="p">;</span>
    
    <span class="c1">// Create a new STYLE node</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">s</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">s</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;style&#39;</span><span class="p">);</span>
        <span class="nx">s</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="s1">&#39;text/css&#39;</span><span class="p">;</span>
        <span class="nx">s</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">getElementsByTagName</span><span class="p">(</span><span class="s1">&#39;head&#39;</span><span class="p">).</span><span class="nx">item</span><span class="p">(</span><span class="mi">0</span><span class="p">).</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">s</span><span class="p">);</span>
        <span class="nx">DT</span><span class="p">.</span><span class="nx">_elDynStyleNode</span> <span class="o">=</span> <span class="nx">s</span><span class="p">;</span>
    <span class="p">}</span>
    
    <span class="c1">// We have a STYLE node to update</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">s</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Use unique classname for this Column instance as a hook for resizing</span>
        <span class="kd">var</span> <span class="nx">sClassname</span> <span class="o">=</span> <span class="s2">&quot;.&quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot;-col-&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getSanitizedKey</span><span class="p">()</span> <span class="o">+</span> <span class="s2">&quot; .&quot;</span> <span class="o">+</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LINER</span><span class="p">;</span>
        
        <span class="c1">// Hide for performance</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;none&#39;</span><span class="p">;</span>
        <span class="p">}</span>
        
        <span class="nx">rule</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">_oDynStyles</span><span class="p">[</span><span class="nx">sClassname</span><span class="p">];</span>

        <span class="c1">// The Column does not yet have a rule</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">rule</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">s</span><span class="p">.</span><span class="nx">styleSheet</span> <span class="o">&amp;&amp;</span> <span class="nx">s</span><span class="p">.</span><span class="nx">styleSheet</span><span class="p">.</span><span class="nx">addRule</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">s</span><span class="p">.</span><span class="nx">styleSheet</span><span class="p">.</span><span class="nx">addRule</span><span class="p">(</span><span class="nx">sClassname</span><span class="p">,</span><span class="s2">&quot;overflow:&quot;</span><span class="o">+</span><span class="nx">sOverflow</span><span class="p">);</span>
                <span class="nx">s</span><span class="p">.</span><span class="nx">styleSheet</span><span class="p">.</span><span class="nx">addRule</span><span class="p">(</span><span class="nx">sClassname</span><span class="p">,</span><span class="s1">&#39;width:&#39;</span><span class="o">+</span><span class="nx">sWidth</span><span class="p">);</span>
                <span class="nx">rule</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">styleSheet</span><span class="p">.</span><span class="nx">rules</span><span class="p">[</span><span class="nx">s</span><span class="p">.</span><span class="nx">styleSheet</span><span class="p">.</span><span class="nx">rules</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                <span class="nx">DT</span><span class="p">.</span><span class="nx">_oDynStyles</span><span class="p">[</span><span class="nx">sClassname</span><span class="p">]</span> <span class="o">=</span> <span class="nx">rule</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">s</span><span class="p">.</span><span class="nx">sheet</span> <span class="o">&amp;&amp;</span> <span class="nx">s</span><span class="p">.</span><span class="nx">sheet</span><span class="p">.</span><span class="nx">insertRule</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">s</span><span class="p">.</span><span class="nx">sheet</span><span class="p">.</span><span class="nx">insertRule</span><span class="p">(</span><span class="nx">sClassname</span><span class="o">+</span><span class="s2">&quot; {overflow:&quot;</span><span class="o">+</span><span class="nx">sOverflow</span><span class="o">+</span><span class="s2">&quot;;width:&quot;</span><span class="o">+</span><span class="nx">sWidth</span><span class="o">+</span><span class="s2">&quot;;}&quot;</span><span class="p">,</span><span class="nx">s</span><span class="p">.</span><span class="nx">sheet</span><span class="p">.</span><span class="nx">cssRules</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                <span class="nx">rule</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">sheet</span><span class="p">.</span><span class="nx">cssRules</span><span class="p">[</span><span class="nx">s</span><span class="p">.</span><span class="nx">sheet</span><span class="p">.</span><span class="nx">cssRules</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                <span class="nx">DT</span><span class="p">.</span><span class="nx">_oDynStyles</span><span class="p">[</span><span class="nx">sClassname</span><span class="p">]</span> <span class="o">=</span> <span class="nx">rule</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// We have a rule to update</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">rule</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">overflow</span> <span class="o">=</span> <span class="nx">sOverflow</span><span class="p">;</span>
            <span class="nx">rule</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">sWidth</span><span class="p">;</span>
        <span class="p">}</span> 
        
        <span class="c1">// Unhide</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    
    <span class="c1">// That was not a success, we must call the fallback routine</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">rule</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">DT</span><span class="p">.</span><span class="nx">_bDynStylesFallback</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidthDynFunction</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sWidth</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Updates width of a Column&#39;s liner DIV elements by dynamically creating a</span>
<span class="cm"> * function to update all element style properties in one pass. Note: This</span>
<span class="cm"> * technique is not supported in sandboxed environments that prohibit EVALs.    </span>
<span class="cm"> *</span>
<span class="cm"> * @method _setColumnWidthDynFunction</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param sWidth {String} New width value.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_setColumnWidthDynFunction</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">sWidth</span><span class="p">,</span> <span class="nx">sOverflow</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// TODO: why is this here?</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">sWidth</span> <span class="o">==</span> <span class="s1">&#39;auto&#39;</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">sWidth</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span> 
    <span class="p">}</span>
    
    <span class="c1">// Create one function for each value of rows.length</span>
    <span class="kd">var</span> <span class="nx">rowslen</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span> <span class="o">:</span> <span class="mi">0</span><span class="p">;</span>
    
    <span class="c1">// Dynamically create the function</span>
    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_aDynFunctions</span><span class="p">[</span><span class="nx">rowslen</span><span class="p">])</span> <span class="p">{</span>
        
        <span class="c1">//Compile a custom function to do all the liner div width</span>
        <span class="c1">//assignments at the same time.  A unique function is required</span>
        <span class="c1">//for each unique number of rows in _elTbody.  This will</span>
        <span class="c1">//result in a function declaration like:</span>
        <span class="c1">//function (oColumn,sWidth,sOverflow) {</span>
        <span class="c1">//    var colIdx = oColumn.getKeyIndex();</span>
        <span class="c1">//    oColumn.getThLinerEl().style.overflow =</span>
        <span class="c1">//    this._elTbody.rows[0].cells[colIdx].firstChild.style.overflow =</span>
        <span class="c1">//    this._elTbody.rows[1].cells[colIdx].firstChild.style.overflow =</span>
        <span class="c1">//    ... (for all row indices in this._elTbody.rows.length - 1)</span>
        <span class="c1">//    this._elTbody.rows[99].cells[colIdx].firstChild.style.overflow =</span>
        <span class="c1">//    sOverflow;</span>
        <span class="c1">//    oColumn.getThLinerEl().style.width =</span>
        <span class="c1">//    this._elTbody.rows[0].cells[colIdx].firstChild.style.width =</span>
        <span class="c1">//    this._elTbody.rows[1].cells[colIdx].firstChild.style.width =</span>
        <span class="c1">//    ... (for all row indices in this._elTbody.rows.length - 1)</span>
        <span class="c1">//    this._elTbody.rows[99].cells[colIdx].firstChild.style.width =</span>
        <span class="c1">//    sWidth;</span>
        <span class="c1">//}</span>
        
        <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span><span class="nx">j</span><span class="p">,</span><span class="nx">k</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">resizerDef</span> <span class="o">=</span> <span class="p">[</span>
            <span class="s1">&#39;var colIdx=oColumn.getKeyIndex();&#39;</span><span class="p">,</span>
            <span class="s1">&#39;oColumn.getThLinerEl().style.overflow=&#39;</span>
        <span class="p">];</span>
        <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">rowslen</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="nx">j</span><span class="o">=</span><span class="mi">2</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">;</span> <span class="o">--</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">j</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;this._elTbody.rows[&#39;</span><span class="p">;</span>
            <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">j</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
            <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">j</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;].cells[colIdx].firstChild.style.overflow=&#39;</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;sOverflow;&#39;</span><span class="p">;</span>
        <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">j</span><span class="o">+</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;oColumn.getThLinerEl().style.width=&#39;</span><span class="p">;</span>
        <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">rowslen</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="nx">k</span><span class="o">=</span><span class="nx">j</span><span class="o">+</span><span class="mi">2</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">;</span> <span class="o">--</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">k</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;this._elTbody.rows[&#39;</span><span class="p">;</span>
            <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">k</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
            <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">k</span><span class="o">++</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;].cells[colIdx].firstChild.style.width=&#39;</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="nx">resizerDef</span><span class="p">[</span><span class="nx">k</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;sWidth;&#39;</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_aDynFunctions</span><span class="p">[</span><span class="nx">rowslen</span><span class="p">]</span> <span class="o">=</span>
            <span class="k">new</span> <span class="nb">Function</span><span class="p">(</span><span class="s1">&#39;oColumn&#39;</span><span class="p">,</span><span class="s1">&#39;sWidth&#39;</span><span class="p">,</span><span class="s1">&#39;sOverflow&#39;</span><span class="p">,</span><span class="nx">resizerDef</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">));</span>
    <span class="p">}</span>
    
    <span class="c1">// Get the function to execute</span>
    <span class="kd">var</span> <span class="nx">resizerFn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aDynFunctions</span><span class="p">[</span><span class="nx">rowslen</span><span class="p">];</span>

    <span class="c1">// TODO: Hide TBODY for performance in _setColumnWidthDynFunction?</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">resizerFn</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">resizerFn</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span><span class="nx">oColumn</span><span class="p">,</span><span class="nx">sWidth</span><span class="p">,</span><span class="nx">sOverflow</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * For one or all Columns, when Column is not hidden, width is not set, and minWidth</span>
<span class="cm"> * and/or maxAutoWidth is set, validates auto-width against minWidth and maxAutoWidth.</span>
<span class="cm"> *</span>
<span class="cm"> * @method validateColumnWidths</span>
<span class="cm"> * @param oArg.column {YAHOO.widget.Column} (optional) One Column to validate. If null, all Columns&#39; widths are validated.</span>
<span class="cm"> */</span>
<span class="nx">validateColumnWidths</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elColgroup</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">elColgroupClone</span> <span class="o">=</span> <span class="nx">elColgroup</span><span class="p">.</span><span class="nx">cloneNode</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">bNeedsValidation</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">allKeys</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">elThLiner</span><span class="p">;</span>
    <span class="c1">// Validate just one Column&#39;s minWidth and/or maxAutoWidth</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">hidden</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">elThLiner</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThLinerEl</span><span class="p">();</span>
            <span class="k">if</span><span class="p">((</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elThLiner</span><span class="p">.</span><span class="nx">offsetWidth</span> <span class="o">&lt;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">elColgroupClone</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()].</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> 
                        <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">+</span> 
                        <span class="p">(</span><span class="nb">parseInt</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">elThLiner</span><span class="p">,</span><span class="s2">&quot;paddingLeft&quot;</span><span class="p">),</span><span class="mi">10</span><span class="p">)</span><span class="o">|</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span>
                        <span class="p">(</span><span class="nb">parseInt</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">elThLiner</span><span class="p">,</span><span class="s2">&quot;paddingRight&quot;</span><span class="p">),</span><span class="mi">10</span><span class="p">)</span><span class="o">|</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">;</span>
                <span class="nx">bNeedsValidation</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">((</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">maxAutoWidth</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elThLiner</span><span class="p">.</span><span class="nx">offsetWidth</span> <span class="o">&gt;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">maxAutoWidth</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidth</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">maxAutoWidth</span><span class="o">+</span><span class="s2">&quot;px&quot;</span><span class="p">,</span> <span class="s2">&quot;hidden&quot;</span><span class="p">);</span>
            <span class="p">}</span>
    <span class="p">}</span>
    <span class="c1">// Validate all Columns</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">allKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">hidden</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">width</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">elThLiner</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThLinerEl</span><span class="p">();</span>
                <span class="k">if</span><span class="p">((</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elThLiner</span><span class="p">.</span><span class="nx">offsetWidth</span> <span class="o">&lt;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">elColgroupClone</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> 
                            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">+</span> 
                            <span class="p">(</span><span class="nb">parseInt</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">elThLiner</span><span class="p">,</span><span class="s2">&quot;paddingLeft&quot;</span><span class="p">),</span><span class="mi">10</span><span class="p">)</span><span class="o">|</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span>
                            <span class="p">(</span><span class="nb">parseInt</span><span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">getStyle</span><span class="p">(</span><span class="nx">elThLiner</span><span class="p">,</span><span class="s2">&quot;paddingRight&quot;</span><span class="p">),</span><span class="mi">10</span><span class="p">)</span><span class="o">|</span><span class="mi">0</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">;</span>
                    <span class="nx">bNeedsValidation</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">((</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">maxAutoWidth</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">elThLiner</span><span class="p">.</span><span class="nx">offsetWidth</span> <span class="o">&gt;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">maxAutoWidth</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_setColumnWidth</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">maxAutoWidth</span><span class="o">+</span><span class="s2">&quot;px&quot;</span><span class="p">,</span> <span class="s2">&quot;hidden&quot;</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">bNeedsValidation</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">elColgroup</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">replaceChild</span><span class="p">(</span><span class="nx">elColgroupClone</span><span class="p">,</span> <span class="nx">elColgroup</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span> <span class="o">=</span> <span class="nx">elColgroupClone</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Clears minWidth.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _clearMinWidth</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Which Column.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_clearMinWidth</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()].</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Restores minWidth.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _restoreMinWidth</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Which Column.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_restoreMinWidth</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elColgroup</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()].</span><span class="nx">style</span><span class="p">.</span><span class="nx">width</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">minWidth</span> <span class="o">+</span> <span class="s1">&#39;px&#39;</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Hides given Column. NOTE: You cannot hide/show nested Columns. You can only</span>
<span class="cm"> * hide/show non-nested Columns, and top-level parent Columns (which will</span>
<span class="cm"> * hide/show all children Columns).</span>
<span class="cm"> *</span>
<span class="cm"> * @method hideColumn</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column | HTMLElement | String | Number} Column</span>
<span class="cm"> * instance, TH/TD element (or child of a TH/TD element), a Column key, or a</span>
<span class="cm"> * ColumnSet key index.</span>
<span class="cm"> */</span>
<span class="nx">hideColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="c1">// Only top-level Columns can get hidden due to issues in FF2 and SF3</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">hidden</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getTreeIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
        
        <span class="kd">var</span> <span class="nx">allrows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">l</span> <span class="o">=</span> <span class="nx">allrows</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">allDescendants</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDescendants</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
        
        <span class="c1">// Hide each nested Column</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allDescendants</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">thisColumn</span> <span class="o">=</span> <span class="nx">allDescendants</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="nx">thisColumn</span><span class="p">.</span><span class="nx">hidden</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

            <span class="c1">// Style the head cell</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">thisColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">(),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIDDEN</span><span class="p">);</span>
            
            <span class="c1">// Does this Column have body cells?</span>
            <span class="kd">var</span> <span class="nx">thisKeyIndex</span> <span class="o">=</span> <span class="nx">thisColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">thisKeyIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>                    
                <span class="c1">// Clear minWidth</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_clearMinWidth</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
                
                <span class="c1">// Style the body cells</span>
                <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">l</span><span class="p">;</span><span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">allrows</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">thisKeyIndex</span><span class="p">],</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIDDEN</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnHideEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">thisColumn</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; hidden&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
      
        <span class="k">this</span><span class="p">.</span><span class="nx">_repaintOpera</span><span class="p">();</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_clearTrTemplateEl</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not hide Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be hidden&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Shows given Column. NOTE: You cannot hide/show nested Columns. You can only</span>
<span class="cm"> * hide/show non-nested Columns, and top-level parent Columns (which will</span>
<span class="cm"> * hide/show all children Columns).</span>
<span class="cm"> *</span>
<span class="cm"> * @method showColumn</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column | HTMLElement | String | Number} Column</span>
<span class="cm"> * instance, TH/TD element (or child of a TH/TD element), a Column key, or a</span>
<span class="cm"> * ColumnSet key index.</span>
<span class="cm"> */</span>
<span class="nx">showColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="c1">// Only top-level Columns can get hidden</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">hidden</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getTreeIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">allrows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">l</span> <span class="o">=</span> <span class="nx">allrows</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">allDescendants</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDescendants</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
        
        <span class="c1">// Show each nested Column</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allDescendants</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">thisColumn</span> <span class="o">=</span> <span class="nx">allDescendants</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="nx">thisColumn</span><span class="p">.</span><span class="nx">hidden</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            
            <span class="c1">// Unstyle the head cell</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">thisColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">(),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIDDEN</span><span class="p">);</span>

            <span class="c1">// Does this Column have body cells?</span>
            <span class="kd">var</span> <span class="nx">thisKeyIndex</span> <span class="o">=</span> <span class="nx">thisColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">thisKeyIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Restore minWidth</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_restoreMinWidth</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
                
            
                <span class="c1">// Unstyle the body cells</span>
                <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">l</span><span class="p">;</span><span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">allrows</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">thisKeyIndex</span><span class="p">],</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIDDEN</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnShowEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">thisColumn</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; shown&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_clearTrTemplateEl</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not show Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be shown&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Removes given Column. NOTE: You cannot remove nested Columns. You can only remove</span>
<span class="cm"> * non-nested Columns, and top-level parent Columns (which will remove all</span>
<span class="cm"> * children Columns).</span>
<span class="cm"> *</span>
<span class="cm"> * @method removeColumn</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @return oColumn {YAHOO.widget.Column} Removed Column instance.</span>
<span class="cm"> */</span>
<span class="nx">removeColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Validate Column</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">nColTreeIndex</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getTreeIndex</span><span class="p">();</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nColTreeIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Which key index(es)</span>
            <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span>
                <span class="nx">aKeyIndexes</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
            <span class="c1">// Must be a parent Column</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">aKeyIndexes</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">descKeyIndexes</span> <span class="o">=</span> <span class="p">[];</span>
                <span class="kd">var</span> <span class="nx">allDescendants</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDescendants</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allDescendants</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Is this descendant a key Column?</span>
                    <span class="kd">var</span> <span class="nx">thisKey</span> <span class="o">=</span> <span class="nx">allDescendants</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getKeyIndex</span><span class="p">();</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">thisKey</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">descKeyIndexes</span><span class="p">[</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">thisKey</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">aKeyIndexes</span> <span class="o">=</span> <span class="nx">descKeyIndexes</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Must be a key Column</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">aKeyIndexes</span> <span class="o">=</span> <span class="p">[</span><span class="nx">aKeyIndexes</span><span class="p">];</span>
            <span class="p">}</span>
            
            <span class="k">if</span><span class="p">(</span><span class="nx">aKeyIndexes</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Sort the indexes so we can remove from the right</span>
                <span class="nx">aKeyIndexes</span><span class="p">.</span><span class="nx">sort</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">)</span> <span class="p">{</span><span class="k">return</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Sort</span><span class="p">.</span><span class="nx">compare</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">);});</span>
                
                <span class="c1">// Destroy previous THEAD</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_destroyTheadEl</span><span class="p">();</span>
    
                <span class="c1">// Create new THEAD</span>
                <span class="kd">var</span> <span class="nx">aOrigColumnDefs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDefinitions</span><span class="p">();</span>
                <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">aOrigColumnDefs</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">nColTreeIndex</span><span class="p">,</span><span class="mi">1</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnSet</span><span class="p">(</span><span class="nx">aOrigColumnDefs</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_initTheadEl</span><span class="p">();</span>
                
                <span class="c1">// Remove COL</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">aKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_removeColgroupColEl</span><span class="p">(</span><span class="nx">aKeyIndexes</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="p">}</span>
                
                <span class="c1">// Remove TD</span>
                <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">;</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">loopN</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">),</span>
                        <span class="nx">loopEnd</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span><span class="p">,</span>
                                    <span class="nx">len</span> <span class="o">=</span> <span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">i</span> <span class="o">+</span> <span class="nx">loopN</span><span class="p">,</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="o">:</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                                    <span class="nx">aIndexes</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">aIndexes</span><span class="p">,</span>
                                    <span class="nx">j</span><span class="p">;</span>
                                <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">for</span><span class="p">(</span><span class="nx">j</span> <span class="o">=</span> <span class="nx">aIndexes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">aIndexes</span><span class="p">[</span><span class="nx">j</span><span class="p">]]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">},</span>
                        <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">loopEnd</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
                        <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">nCurrentRow</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span> <span class="nx">aIndexes</span><span class="o">:</span><span class="nx">aKeyIndexes</span><span class="p">},</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                    <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                <span class="p">}</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnRemoveEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">});</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; removed&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                <span class="k">return</span> <span class="nx">oColumn</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not remove Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be removed&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Inserts given Column at the index if given, otherwise at the end. NOTE: You</span>
<span class="cm"> * can only add non-nested Columns and top-level parent Columns. You cannot add</span>
<span class="cm"> * a nested Column to an existing parent.</span>
<span class="cm"> *</span>
<span class="cm"> * @method insertColumn</span>
<span class="cm"> * @param oColumn {Object | YAHOO.widget.Column} Object literal Column</span>
<span class="cm"> * definition or a Column instance.</span>
<span class="cm"> * @param index {Number} (optional) New tree index.</span>
<span class="cm"> * @return oColumn {YAHOO.widget.Column} Inserted Column instance. </span>
<span class="cm"> */</span>
<span class="nx">insertColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Validate Column</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getDefinition</span><span class="p">();</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">constructor</span> <span class="o">!==</span> <span class="nb">Object</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not insert Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span> <span class="o">+</span> <span class="s2">&quot;\&quot; due to invalid argument&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
    
    <span class="c1">// Validate index or append new Column to the end of the ColumnSet</span>
    <span class="kd">var</span> <span class="nx">oColumnSet</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isValue</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="o">||</span> <span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">index</span> <span class="o">=</span> <span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">[</span><span class="mi">0</span><span class="p">].</span><span class="nx">length</span><span class="p">;</span>
    <span class="p">}</span>
    
    <span class="c1">// Destroy previous THEAD</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_destroyTheadEl</span><span class="p">();</span>
    
    <span class="c1">// Create new THEAD</span>
    <span class="kd">var</span> <span class="nx">aNewColumnDefs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDefinitions</span><span class="p">();</span>
    <span class="nx">aNewColumnDefs</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">index</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">);</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnSet</span><span class="p">(</span><span class="nx">aNewColumnDefs</span><span class="p">);</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_initTheadEl</span><span class="p">();</span>
    
    <span class="c1">// Need to refresh the reference</span>
    <span class="nx">oColumnSet</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">oNewColumn</span> <span class="o">=</span> <span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="nx">index</span><span class="p">];</span>
    
    <span class="c1">// Get key index(es) for new Column</span>
    <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span>
        <span class="nx">descKeyIndexes</span> <span class="o">=</span> <span class="p">[];</span>
    <span class="kd">var</span> <span class="nx">allDescendants</span> <span class="o">=</span> <span class="nx">oColumnSet</span><span class="p">.</span><span class="nx">getDescendants</span><span class="p">(</span><span class="nx">oNewColumn</span><span class="p">);</span>
    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allDescendants</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Is this descendant a key Column?</span>
        <span class="kd">var</span> <span class="nx">thisKey</span> <span class="o">=</span> <span class="nx">allDescendants</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getKeyIndex</span><span class="p">();</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">thisKey</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">descKeyIndexes</span><span class="p">[</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">thisKey</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    
    <span class="k">if</span><span class="p">(</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>  
        <span class="c1">// Sort the indexes</span>
        <span class="kd">var</span> <span class="nx">newIndex</span> <span class="o">=</span> <span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">sort</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">)</span> <span class="p">{</span><span class="k">return</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Sort</span><span class="p">.</span><span class="nx">compare</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">);})[</span><span class="mi">0</span><span class="p">];</span>
        
        <span class="c1">// Add COL</span>
        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_insertColgroupColEl</span><span class="p">(</span><span class="nx">descKeyIndexes</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
        <span class="p">}</span>
            
        <span class="c1">// Add TD</span>
        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">loopN</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">),</span>
                <span class="nx">loopEnd</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
            
            <span class="c1">// Get templates for each new TD</span>
            <span class="kd">var</span> <span class="nx">aTdTemplates</span> <span class="o">=</span> <span class="p">[],</span>
                <span class="nx">elTdTemplate</span><span class="p">;</span>
            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">thisKeyIndex</span> <span class="o">=</span> <span class="nx">descKeyIndexes</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                <span class="nx">elTdTemplate</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getTrTemplateEl</span><span class="p">().</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cloneNode</span><span class="p">(</span><span class="kc">true</span><span class="p">);</span>
                <span class="nx">elTdTemplate</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_formatTdEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">[</span><span class="nx">thisKeyIndex</span><span class="p">],</span> <span class="nx">elTdTemplate</span><span class="p">,</span> <span class="nx">thisKeyIndex</span><span class="p">,</span> <span class="p">(</span><span class="nx">thisKeyIndex</span><span class="o">===</span><span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">));</span>
                <span class="nx">aTdTemplates</span><span class="p">[</span><span class="nx">thisKeyIndex</span><span class="p">]</span> <span class="o">=</span> <span class="nx">elTdTemplate</span><span class="p">;</span>
            <span class="p">}</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span><span class="p">,</span> <span class="nx">j</span><span class="p">,</span>
                            <span class="nx">descKeyIndexes</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">descKeyIndexes</span><span class="p">,</span>
                            <span class="nx">len</span> <span class="o">=</span> <span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">i</span> <span class="o">+</span> <span class="nx">loopN</span><span class="p">,</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="o">:</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                            <span class="nx">nextSibling</span><span class="p">;</span>
                        <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">nextSibling</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">newIndex</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">aTdTemplates</span><span class="p">[</span><span class="nx">descKeyIndexes</span><span class="p">[</span><span class="nx">j</span><span class="p">]].</span><span class="nx">cloneNode</span><span class="p">(</span><span class="kc">true</span><span class="p">),</span> <span class="nx">nextSibling</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">},</span>
                <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">loopEnd</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
                <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">nCurrentRow</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span><span class="nx">aTdTemplates</span><span class="o">:</span><span class="nx">aTdTemplates</span><span class="p">,</span><span class="nx">descKeyIndexes</span><span class="o">:</span><span class="nx">descKeyIndexes</span><span class="p">},</span>
                <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
            <span class="p">});</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span> 
        <span class="p">}</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnInsertEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">,</span><span class="nx">index</span><span class="o">:</span><span class="nx">index</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; inserted into index &quot;</span> <span class="o">+</span> <span class="nx">index</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span> <span class="nx">oNewColumn</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Removes given Column and inserts into given tree index. NOTE: You</span>
<span class="cm"> * can only reorder non-nested Columns and top-level parent Columns. You cannot</span>
<span class="cm"> * reorder a nested Column to an existing parent.</span>
<span class="cm"> *</span>
<span class="cm"> * @method reorderColumn</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param index {Number} New tree index.</span>
<span class="cm"> * @return oColumn {YAHOO.widget.Column} Reordered Column instance. </span>
<span class="cm"> */</span>
<span class="nx">reorderColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Validate Column and new index</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">nOrigTreeIndex</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getTreeIndex</span><span class="p">();</span>
        <span class="k">if</span><span class="p">((</span><span class="nx">nOrigTreeIndex</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nOrigTreeIndex</span> <span class="o">!==</span> <span class="nx">index</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// Which key index(es)</span>
            <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">len</span><span class="p">,</span>
                <span class="nx">aOrigKeyIndexes</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">(),</span>
                <span class="nx">allDescendants</span><span class="p">,</span>
                <span class="nx">descKeyIndexes</span> <span class="o">=</span> <span class="p">[],</span>
                <span class="nx">thisKey</span><span class="p">;</span>
            <span class="c1">// Must be a parent Column...</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">aOrigKeyIndexes</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">allDescendants</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDescendants</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allDescendants</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Is this descendant a key Column?</span>
                    <span class="nx">thisKey</span> <span class="o">=</span> <span class="nx">allDescendants</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getKeyIndex</span><span class="p">();</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">thisKey</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">descKeyIndexes</span><span class="p">[</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">thisKey</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">aOrigKeyIndexes</span> <span class="o">=</span> <span class="nx">descKeyIndexes</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// ...or else must be a key Column</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">aOrigKeyIndexes</span> <span class="o">=</span> <span class="p">[</span><span class="nx">aOrigKeyIndexes</span><span class="p">];</span>
            <span class="p">}</span>
            
            <span class="k">if</span><span class="p">(</span><span class="nx">aOrigKeyIndexes</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>                   
                <span class="c1">// Sort the indexes</span>
                <span class="nx">aOrigKeyIndexes</span><span class="p">.</span><span class="nx">sort</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">)</span> <span class="p">{</span><span class="k">return</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Sort</span><span class="p">.</span><span class="nx">compare</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">);});</span>
                
                <span class="c1">// Destroy previous THEAD</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_destroyTheadEl</span><span class="p">();</span>
    
                <span class="c1">// Create new THEAD</span>
                <span class="kd">var</span> <span class="nx">aColumnDefs</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDefinitions</span><span class="p">();</span>
                <span class="kd">var</span> <span class="nx">oColumnDef</span> <span class="o">=</span> <span class="nx">aColumnDefs</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">nOrigTreeIndex</span><span class="p">,</span><span class="mi">1</span><span class="p">)[</span><span class="mi">0</span><span class="p">];</span>
                <span class="nx">aColumnDefs</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">index</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">oColumnDef</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_initColumnSet</span><span class="p">(</span><span class="nx">aColumnDefs</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_initTheadEl</span><span class="p">();</span>
                
                <span class="c1">// Need to refresh the reference</span>
                <span class="kd">var</span> <span class="nx">oNewColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">tree</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="nx">index</span><span class="p">];</span>

                <span class="c1">// What are new key index(es)</span>
                <span class="kd">var</span> <span class="nx">aNewKeyIndexes</span> <span class="o">=</span> <span class="nx">oNewColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
                <span class="c1">// Must be a parent Column</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">aNewKeyIndexes</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">descKeyIndexes</span> <span class="o">=</span> <span class="p">[];</span>
                    <span class="nx">allDescendants</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">getDescendants</span><span class="p">(</span><span class="nx">oNewColumn</span><span class="p">);</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">allDescendants</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Is this descendant a key Column?</span>
                        <span class="nx">thisKey</span> <span class="o">=</span> <span class="nx">allDescendants</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getKeyIndex</span><span class="p">();</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">thisKey</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">descKeyIndexes</span><span class="p">[</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">thisKey</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">descKeyIndexes</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">aNewKeyIndexes</span> <span class="o">=</span> <span class="nx">descKeyIndexes</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Must be a key Column</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="nx">aNewKeyIndexes</span> <span class="o">=</span> <span class="p">[</span><span class="nx">aNewKeyIndexes</span><span class="p">];</span>
                <span class="p">}</span>
                
                <span class="c1">// Sort the new indexes and grab the first one for the new location</span>
                <span class="kd">var</span> <span class="nx">newIndex</span> <span class="o">=</span> <span class="nx">aNewKeyIndexes</span><span class="p">.</span><span class="nx">sort</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">)</span> <span class="p">{</span><span class="k">return</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Sort</span><span class="p">.</span><span class="nx">compare</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">);})[</span><span class="mi">0</span><span class="p">];</span>

                <span class="c1">// Reorder COL</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_reorderColgroupColEl</span><span class="p">(</span><span class="nx">aOrigKeyIndexes</span><span class="p">,</span> <span class="nx">newIndex</span><span class="p">);</span>
                
                <span class="c1">// Reorder TD</span>
                <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">;</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">loopN</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">),</span>
                        <span class="nx">loopEnd</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span><span class="p">,</span> <span class="nx">j</span><span class="p">,</span> <span class="nx">tmpTds</span><span class="p">,</span> <span class="nx">nextSibling</span><span class="p">,</span>
                                    <span class="nx">len</span> <span class="o">=</span> <span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">i</span> <span class="o">+</span> <span class="nx">loopN</span><span class="p">,</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="o">:</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                                    <span class="nx">aIndexes</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">aIndexes</span><span class="p">,</span> <span class="nx">thisTr</span><span class="p">;</span>
                                <span class="c1">// For each row</span>
                                <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="p">;</span> <span class="o">++</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="nx">tmpTds</span> <span class="o">=</span> <span class="p">[];</span>
                                    <span class="nx">thisTr</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                                    
                                    <span class="c1">// Remove each TD</span>
                                    <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">aIndexes</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="nx">tmpTds</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">thisTr</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">thisTr</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">aIndexes</span><span class="p">[</span><span class="nx">j</span><span class="p">]]));</span>
                                    <span class="p">}</span>
                                    
                                    <span class="c1">// Insert each TD</span>
                                    <span class="nx">nextSibling</span> <span class="o">=</span> <span class="nx">thisTr</span><span class="p">.</span><span class="nx">childNodes</span><span class="p">[</span><span class="nx">newIndex</span><span class="p">]</span> <span class="o">||</span> <span class="kc">null</span><span class="p">;</span>
                                    <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">tmpTds</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="nx">thisTr</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">tmpTds</span><span class="p">[</span><span class="nx">j</span><span class="p">],</span> <span class="nx">nextSibling</span><span class="p">);</span>
                                    <span class="p">}</span>                                    
                                <span class="p">}</span>
                                <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">},</span>
                        <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">loopEnd</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
                        <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">nCurrentRow</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span> <span class="nx">aIndexes</span><span class="o">:</span><span class="nx">aOrigKeyIndexes</span><span class="p">},</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                    <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                <span class="p">}</span>
        
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnReorderEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oNewColumn</span><span class="p">,</span> <span class="nx">oldIndex</span><span class="o">:</span><span class="nx">nOrigTreeIndex</span><span class="p">});</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oNewColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; reordered&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                <span class="k">return</span> <span class="nx">oNewColumn</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not reorder Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be reordered&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Selects given Column. NOTE: You cannot select/unselect nested Columns. You can only</span>
<span class="cm"> * select/unselect non-nested Columns, and bottom-level key Columns.</span>
<span class="cm"> *</span>
<span class="cm"> * @method selectColumn</span>
<span class="cm"> * @param column {HTMLElement | String | Number} DOM reference or ID string to a</span>
<span class="cm"> * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.</span>
<span class="cm"> */</span>
<span class="nx">selectColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">selected</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Only bottom-level Columns can get hidden</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">selected</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            
            <span class="c1">// Update head cell</span>
            <span class="kd">var</span> <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>

            <span class="c1">// Update body cells</span>
            <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">oChainRender</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">;</span>
            <span class="nx">oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">])</span> <span class="p">{</span>
                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">],</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>                    
                    <span class="p">}</span>
                    <span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="o">++</span><span class="p">;</span>
                <span class="p">},</span>
                <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                <span class="nx">iterations</span><span class="o">:</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">rowIndex</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span><span class="nx">cellIndex</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()}</span>
            <span class="p">});</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">_clearTrTemplateEl</span><span class="p">();</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>      
            
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnSelectEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; selected&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not select Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be selected&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Unselects given Column. NOTE: You cannot select/unselect nested Columns. You can only</span>
<span class="cm"> * select/unselect non-nested Columns, and bottom-level key Columns.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unselectColumn</span>
<span class="cm"> * @param column {HTMLElement | String | Number} DOM reference or ID string to a</span>
<span class="cm"> * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.</span>
<span class="cm"> */</span>
<span class="nx">unselectColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">selected</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Only bottom-level Columns can get hidden</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">oColumn</span><span class="p">.</span><span class="nx">selected</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            
            <span class="c1">// Update head cell</span>
            <span class="kd">var</span> <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>

            <span class="c1">// Update body cells</span>
            <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">oChainRender</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">;</span>
            <span class="nx">oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">])</span> <span class="p">{</span>
                        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">],</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span> 
                    <span class="p">}</span>                   
                    <span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="o">++</span><span class="p">;</span>
                <span class="p">},</span>
                <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                <span class="nx">iterations</span><span class="o">:</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">rowIndex</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span><span class="nx">cellIndex</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()}</span>
            <span class="p">});</span>
            
            <span class="k">this</span><span class="p">.</span><span class="nx">_clearTrTemplateEl</span><span class="p">();</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>      
            
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnUnselectEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; unselected&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not unselect Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be unselected&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns an array selected Column instances.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getSelectedColumns</span>
<span class="cm"> * @return {YAHOO.widget.Column[]} Array of Column instances.</span>
<span class="cm"> */</span>
<span class="nx">getSelectedColumns</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">selectedColumns</span> <span class="o">=</span> <span class="p">[];</span>
    <span class="kd">var</span> <span class="nx">aKeys</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oColumnSet</span><span class="p">.</span><span class="nx">keys</span><span class="p">;</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span><span class="nx">len</span><span class="o">=</span><span class="nx">aKeys</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">aKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">selected</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">selectedColumns</span><span class="p">[</span><span class="nx">selectedColumns</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="nx">aKeys</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nx">selectedColumns</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to cells of the given Column.</span>
<span class="cm"> * NOTE: You cannot highlight/unhighlight nested Columns. You can only</span>
<span class="cm"> * highlight/unhighlight non-nested Columns, and bottom-level key Columns.</span>
<span class="cm"> *</span>
<span class="cm"> * @method highlightColumn</span>
<span class="cm"> * @param column {HTMLElement | String | Number} DOM reference or ID string to a</span>
<span class="cm"> * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.</span>
<span class="cm"> */</span>
<span class="nx">highlightColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">column</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">column</span><span class="p">);</span>
    <span class="c1">// Only bottom-level Columns can get highlighted</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>            
        <span class="c1">// Update head cell</span>
        <span class="kd">var</span> <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>

        <span class="c1">// Update body cells</span>
        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">oChainRender</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">;</span>
        <span class="nx">oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
            <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">])</span> <span class="p">{</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">],</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>   
                <span class="p">}</span>                 
                <span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="o">++</span><span class="p">;</span>
            <span class="p">},</span>
            <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">iterations</span><span class="o">:</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
            <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">rowIndex</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span><span class="nx">cellIndex</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()},</span>
            <span class="nx">timeout</span><span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
        <span class="p">});</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>      
            
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnHighlightEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; highlighed&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not highlight Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be highlighted&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to cells of the given Column.</span>
<span class="cm"> * NOTE: You cannot highlight/unhighlight nested Columns. You can only</span>
<span class="cm"> * highlight/unhighlight non-nested Columns, and bottom-level key Columns.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unhighlightColumn</span>
<span class="cm"> * @param column {HTMLElement | String | Number} DOM reference or ID string to a</span>
<span class="cm"> * TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.</span>
<span class="cm"> */</span>
<span class="nx">unhighlightColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">column</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">column</span><span class="p">);</span>
    <span class="c1">// Only bottom-level Columns can get highlighted</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Update head cell</span>
        <span class="kd">var</span> <span class="nx">elTh</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">();</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elTh</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>

        <span class="c1">// Update body cells</span>
        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">oChainRender</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">;</span>
        <span class="nx">oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
            <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">])</span> <span class="p">{</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">cellIndex</span><span class="p">],</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>
                <span class="p">}</span>                 
                <span class="nx">oArg</span><span class="p">.</span><span class="nx">rowIndex</span><span class="o">++</span><span class="p">;</span>
            <span class="p">},</span>
            <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
            <span class="nx">iterations</span><span class="o">:</span><span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
            <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">rowIndex</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span><span class="nx">cellIndex</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">()},</span>
            <span class="nx">timeout</span><span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
        <span class="p">});</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>     
            
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;columnUnhighlightEvent&quot;</span><span class="p">,{</span><span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot; unhighlighted&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not unhighlight Column \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span> <span class="o">+</span> <span class="s2">&quot;\&quot;. Only non-nested Columns can be unhighlighted&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>












































<span class="c1">// ROW FUNCTIONS</span>

<span class="cm">/**</span>
<span class="cm"> * Adds one new Record of data into the RecordSet at the index if given,</span>
<span class="cm"> * otherwise at the end. If the new Record is in page view, the</span>
<span class="cm"> * corresponding DOM elements are also updated.</span>
<span class="cm"> *</span>
<span class="cm"> * @method addRow</span>
<span class="cm"> * @param oData {Object} Object literal of data for the row.</span>
<span class="cm"> * @param index {Number} (optional) RecordSet position index at which to add data.</span>
<span class="cm"> */</span>
<span class="nx">addRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">index</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="o">||</span> <span class="nx">index</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getLength</span><span class="p">()))</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not add row at index &quot;</span> <span class="o">+</span> <span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot; with &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oData</span><span class="p">),</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">oData</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">oData</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">addRecord</span><span class="p">(</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">index</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">recIndex</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>

            <span class="c1">// Paginated</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>     
                <span class="c1">// Update the paginator&#39;s totalRecords</span>
                <span class="kd">var</span> <span class="nx">totalRecords</span> <span class="o">=</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">totalRecords</span> <span class="o">!==</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Paginator</span><span class="p">.</span><span class="nx">VALUE_UNLIMITED</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">,</span><span class="nx">totalRecords</span> <span class="o">+</span> <span class="mi">1</span><span class="p">);</span>
                <span class="p">}</span>

                <span class="nx">recIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">endRecIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">())[</span><span class="mi">1</span><span class="p">];</span>

                <span class="c1">// New record affects the view</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">recIndex</span> <span class="o">&lt;=</span> <span class="nx">endRecIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Defer UI updates to the render method</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                <span class="p">}</span>
                
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowAddEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">});</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Added a row for Record &quot;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; at RecordSet index &quot;</span> <span class="o">+</span> <span class="nx">recIndex</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span> 
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="c1">// Not paginated</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">recIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">);</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">recIndex</span><span class="p">))</span> <span class="p">{</span>
                    <span class="c1">// Add the TR element</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">record</span><span class="p">;</span>
                                <span class="kd">var</span> <span class="nx">recIndex</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">recIndex</span><span class="p">;</span>
                                <span class="kd">var</span> <span class="nx">elNewTr</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_addTrEl</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">);</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">elNewTr</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="kd">var</span> <span class="nx">elNext</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">[</span><span class="nx">recIndex</span><span class="p">])</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">[</span><span class="nx">recIndex</span><span class="p">]</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">elNewTr</span><span class="p">,</span> <span class="nx">elNext</span><span class="p">);</span>

                                    <span class="c1">// Set FIRST/LAST</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">recIndex</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">_setFirstRow</span><span class="p">();</span>
                                    <span class="p">}</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">elNext</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">_setLastRow</span><span class="p">();</span>
                                    <span class="p">}</span>
                                    <span class="c1">// Set EVEN/ODD</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_setRowStripes</span><span class="p">();</span>                           
                                    
                                    <span class="k">this</span><span class="p">.</span><span class="nx">hideTableMessage</span><span class="p">();</span>
            
                                    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowAddEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">});</span>
                                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Added a row for Record &quot;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; at RecordSet index &quot;</span> <span class="o">+</span> <span class="nx">recIndex</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">},</span>
                        <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">recIndex</span><span class="o">:</span> <span class="nx">recIndex</span><span class="p">},</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                    <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>            
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not add row at index &quot;</span> <span class="o">+</span> <span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot; with &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oData</span><span class="p">),</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Convenience method to add multiple rows.</span>
<span class="cm"> *</span>
<span class="cm"> * @method addRows</span>
<span class="cm"> * @param aData {Object[]} Array of object literal data for the rows.</span>
<span class="cm"> * @param index {Number} (optional) RecordSet position index at which to add data.</span>
<span class="cm"> */</span>
<span class="nx">addRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">aData</span><span class="p">,</span> <span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">index</span> <span class="o">&lt;</span> <span class="mi">0</span> <span class="o">||</span> <span class="nx">index</span> <span class="o">&gt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getLength</span><span class="p">()))</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not add rows at index &quot;</span> <span class="o">+</span> <span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot; with &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">aData</span><span class="p">),</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>    
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">aData</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">aRecords</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">addRecords</span><span class="p">(</span><span class="nx">aData</span><span class="p">,</span> <span class="nx">index</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">aRecords</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">recIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">aRecords</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
            
            <span class="c1">// Paginated</span>
            <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Update the paginator&#39;s totalRecords</span>
                <span class="kd">var</span> <span class="nx">totalRecords</span> <span class="o">=</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">totalRecords</span> <span class="o">!==</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Paginator</span><span class="p">.</span><span class="nx">VALUE_UNLIMITED</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">,</span><span class="nx">totalRecords</span> <span class="o">+</span> <span class="nx">aRecords</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                <span class="p">}</span>
    
                <span class="kd">var</span> <span class="nx">endRecIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">())[</span><span class="mi">1</span><span class="p">];</span>

                <span class="c1">// At least one of the new records affects the view</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">recIndex</span> <span class="o">&lt;=</span> <span class="nx">endRecIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                <span class="p">}</span>
                
                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowsAddEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">records</span><span class="o">:</span><span class="nx">aRecords</span><span class="p">});</span>
                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Added &quot;</span> <span class="o">+</span> <span class="nx">aRecords</span><span class="p">.</span><span class="nx">length</span> <span class="o">+</span> 
                        <span class="s2">&quot; rows at index &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">aRecords</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span>
                        <span class="s2">&quot; with data &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">aData</span><span class="p">),</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="c1">// Not paginated</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Add the TR elements</span>
                <span class="kd">var</span> <span class="nx">loopN</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">);</span>
                <span class="kd">var</span> <span class="nx">loopEnd</span> <span class="o">=</span> <span class="nx">recIndex</span> <span class="o">+</span> <span class="nx">aData</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
                <span class="kd">var</span> <span class="nx">nRowsNeeded</span> <span class="o">=</span> <span class="p">(</span><span class="nx">loopEnd</span> <span class="o">-</span> <span class="nx">recIndex</span><span class="p">);</span> <span class="c1">// how many needed</span>
                <span class="kd">var</span> <span class="nx">isLast</span> <span class="o">=</span> <span class="p">(</span><span class="nx">recIndex</span> <span class="o">&gt;=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                    <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">aRecords</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">aRecords</span><span class="p">,</span>
                                <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span><span class="p">,</span>
                                <span class="nx">j</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRecord</span><span class="p">,</span>
                                <span class="nx">len</span> <span class="o">=</span> <span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">i</span> <span class="o">+</span> <span class="nx">loopN</span><span class="p">,</span><span class="nx">loopEnd</span><span class="p">)</span> <span class="o">:</span> <span class="nx">loopEnd</span><span class="p">,</span>
                                <span class="nx">df</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createDocumentFragment</span><span class="p">(),</span>
                                <span class="nx">elNext</span> <span class="o">=</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
                            <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">,</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">df</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_addTrEl</span><span class="p">(</span><span class="nx">aRecords</span><span class="p">[</span><span class="nx">j</span><span class="p">]));</span>
                            <span class="p">}</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">df</span><span class="p">,</span> <span class="nx">elNext</span><span class="p">);</span>
                            <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                            <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRecord</span> <span class="o">=</span> <span class="nx">j</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">},</span>
                    <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">loopEnd</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
                    <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">nCurrentRow</span><span class="o">:</span><span class="nx">recIndex</span><span class="p">,</span><span class="nx">nCurrentRecord</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span><span class="nx">aRecords</span><span class="o">:</span><span class="nx">aRecords</span><span class="p">},</span>
                    <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                    <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                <span class="p">});</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                    <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                        <span class="kd">var</span> <span class="nx">recIndex</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">recIndex</span><span class="p">;</span>
                        <span class="c1">// Set FIRST/LAST</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">recIndex</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_setFirstRow</span><span class="p">();</span>
                        <span class="p">}</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">isLast</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_setLastRow</span><span class="p">();</span>
                        <span class="p">}</span>
                        <span class="c1">// Set EVEN/ODD</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_setRowStripes</span><span class="p">();</span>                           

                        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowsAddEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">records</span><span class="o">:</span><span class="nx">aRecords</span><span class="p">});</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Added &quot;</span> <span class="o">+</span> <span class="nx">aRecords</span><span class="p">.</span><span class="nx">length</span> <span class="o">+</span> 
                                <span class="s2">&quot; rows at index &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">aRecords</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">+</span>
                                <span class="s2">&quot; with data &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">aData</span><span class="p">),</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                    <span class="p">},</span>
                    <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">recIndex</span><span class="o">:</span> <span class="nx">recIndex</span><span class="p">,</span> <span class="nx">isLast</span><span class="o">:</span> <span class="nx">isLast</span><span class="p">},</span>
                    <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                    <span class="nx">timeout</span><span class="o">:</span> <span class="o">-</span><span class="mi">1</span> <span class="c1">// Needs to run immediately after the DOM insertions above</span>
                <span class="p">});</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">hideTableMessage</span><span class="p">();</span>                
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>            
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not add rows at index &quot;</span> <span class="o">+</span> <span class="nx">index</span> <span class="o">+</span> <span class="s2">&quot; with &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">aData</span><span class="p">),</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>    
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * For the given row, updates the associated Record with the given data. If the</span>
<span class="cm"> * row is on current page, the corresponding DOM elements are also updated.</span>
<span class="cm"> *</span>
<span class="cm"> * @method updateRow</span>
<span class="cm"> * @param row {YAHOO.widget.Record | Number | HTMLElement | String}</span>
<span class="cm"> * Which row to update: By Record instance, by Record&#39;s RecordSet</span>
<span class="cm"> * position index, by HTMLElement reference to the TR element, or by ID string</span>
<span class="cm"> * of the TR element.</span>
<span class="cm"> * @param oData {Object} Object literal of data for the row.</span>
<span class="cm"> */</span>
<span class="nx">updateRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">,</span> <span class="nx">oData</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">index</span> <span class="o">=</span> <span class="nx">row</span><span class="p">;</span>
    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">index</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
    <span class="p">}</span>

    <span class="c1">// Update the Record</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">index</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecordSet</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">,</span>
            <span class="nx">oldRecord</span> <span class="o">=</span> <span class="nx">oRecordSet</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">index</span><span class="p">);</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">oldRecord</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">updatedRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">setRecord</span><span class="p">(</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">index</span><span class="p">),</span>
                <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">oldRecord</span><span class="p">),</span>
                <span class="c1">// Copy data from the Record for the event that gets fired later</span>
                <span class="nx">oldData</span> <span class="o">=</span> <span class="nx">oldRecord</span> <span class="o">?</span> <span class="nx">oldRecord</span><span class="p">.</span><span class="nx">getData</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>

            <span class="k">if</span><span class="p">(</span><span class="nx">updatedRecord</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Update selected rows as necessary</span>
                <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[],</span>
                <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
                <span class="nx">oldId</span> <span class="o">=</span> <span class="nx">oldRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">(),</span>
                <span class="nx">newId</span> <span class="o">=</span> <span class="nx">updatedRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>
                <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">((</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">newId</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">=</span> <span class="nx">newId</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="c1">// Update anchors as necessary</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">updatedRecord</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">.</span><span class="nx">record</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">.</span><span class="nx">record</span> <span class="o">=</span> <span class="nx">updatedRecord</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// Update the TR only if row is on current page</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                    <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                            <span class="c1">// Paginated</span>
                            <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
                            <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
                                <span class="kd">var</span> <span class="nx">pageStartIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">())[</span><span class="mi">0</span><span class="p">],</span>
                                    <span class="nx">pageLastIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">())[</span><span class="mi">1</span><span class="p">];</span>

                                <span class="c1">// At least one of the new records affects the view</span>
                                <span class="k">if</span> <span class="p">((</span><span class="nx">index</span> <span class="o">&gt;=</span> <span class="nx">pageStartIndex</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">index</span> <span class="o">&lt;=</span> <span class="nx">pageLastIndex</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                            <span class="k">else</span> <span class="p">{</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_updateTrEl</span><span class="p">(</span><span class="nx">elRow</span><span class="p">,</span> <span class="nx">updatedRecord</span><span class="p">);</span>
                                <span class="p">}</span>
                                <span class="k">else</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_addTrEl</span><span class="p">(</span><span class="nx">updatedRecord</span><span class="p">));</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowUpdateEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">updatedRecord</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">oldData</span><span class="p">});</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable row updated: Record ID = &quot;</span> <span class="o">+</span> <span class="nx">updatedRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span>
                                    <span class="s2">&quot;, Record index = &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">updatedRecord</span><span class="p">)</span> <span class="o">+</span>
                                    <span class="s2">&quot;, page row index = &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">updatedRecord</span><span class="p">),</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                        <span class="p">}</span>
                    <span class="p">},</span>
                    <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                    <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                <span class="p">});</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not update row &quot;</span> <span class="o">+</span> <span class="nx">row</span> <span class="o">+</span> <span class="s2">&quot; with the data : &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oData</span><span class="p">),</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Starting with the given row, updates associated Records with the given data.</span>
<span class="cm"> * The number of rows to update are determined by the array of data provided.</span>
<span class="cm"> * Undefined data (i.e., not an object literal) causes a row to be skipped. If</span>
<span class="cm"> * any of the rows are on current page, the corresponding DOM elements are also</span>
<span class="cm"> * updated.</span>
<span class="cm"> *</span>
<span class="cm"> * @method updateRows</span>
<span class="cm"> * @param startrow {YAHOO.widget.Record | Number | HTMLElement | String}</span>
<span class="cm"> * Starting row to update: By Record instance, by Record&#39;s RecordSet</span>
<span class="cm"> * position index, by HTMLElement reference to the TR element, or by ID string</span>
<span class="cm"> * of the TR element.</span>
<span class="cm"> * @param aData {Object[]} Array of object literal of data for the rows.</span>
<span class="cm"> */</span>
<span class="nx">updateRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">startrow</span><span class="p">,</span> <span class="nx">aData</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">aData</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">startIndex</span> <span class="o">=</span> <span class="nx">startrow</span><span class="p">,</span>
            <span class="nx">oRecordSet</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">,</span>
            <span class="nx">lastRowIndex</span> <span class="o">=</span> <span class="nx">oRecordSet</span><span class="p">.</span><span class="nx">getLength</span><span class="p">();</span>

        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">startrow</span><span class="p">))</span> <span class="p">{</span>
            <span class="nx">startIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">startrow</span><span class="p">);</span>
        <span class="p">}</span>
            
        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">startIndex</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">startIndex</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">startIndex</span> <span class="o">&lt;</span> <span class="nx">oRecordSet</span><span class="p">.</span><span class="nx">getLength</span><span class="p">()))</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">lastIndex</span> <span class="o">=</span> <span class="nx">startIndex</span> <span class="o">+</span> <span class="nx">aData</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                <span class="nx">aOldRecords</span> <span class="o">=</span> <span class="nx">oRecordSet</span><span class="p">.</span><span class="nx">getRecords</span><span class="p">(</span><span class="nx">startIndex</span><span class="p">,</span> <span class="nx">aData</span><span class="p">.</span><span class="nx">length</span><span class="p">),</span>
                <span class="nx">aNewRecords</span> <span class="o">=</span> <span class="nx">oRecordSet</span><span class="p">.</span><span class="nx">setRecords</span><span class="p">(</span><span class="nx">aData</span><span class="p">,</span> <span class="nx">startIndex</span><span class="p">);</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">aNewRecords</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[],</span>
                    <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="nx">j</span><span class="p">,</span> <span class="nx">newRecord</span><span class="p">,</span> <span class="nx">newId</span><span class="p">,</span> <span class="nx">oldId</span><span class="p">,</span>
                    <span class="nx">anchorRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                    <span class="nx">anchorCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">.</span><span class="nx">record</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
                <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">aOldRecords</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oldId</span> <span class="o">=</span> <span class="nx">aOldRecords</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">getId</span><span class="p">();</span>
                    <span class="nx">newRecord</span> <span class="o">=</span> <span class="nx">aNewRecords</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="nx">newId</span> <span class="o">=</span> <span class="nx">newRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>

                    <span class="c1">// Update selected rows as necessary</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span><span class="p">((</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">=</span> <span class="nx">newId</span><span class="p">;</span>
                        <span class="p">}</span>
                        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">=</span> <span class="nx">newId</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>

                    <span class="c1">// Update anchors as necessary</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">anchorRecord</span> <span class="o">&amp;&amp;</span> <span class="nx">anchorRecord</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">newRecord</span><span class="p">;</span>
                    <span class="p">}</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">anchorCell</span> <span class="o">&amp;&amp;</span> <span class="nx">anchorCell</span> <span class="o">===</span> <span class="nx">oldId</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">.</span><span class="nx">record</span> <span class="o">=</span> <span class="nx">newRecord</span><span class="p">;</span>
                    <span class="p">}</span>
               <span class="p">}</span>

                <span class="c1">// Paginated</span>
                <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">pageStartIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">())[</span><span class="mi">0</span><span class="p">],</span>
                        <span class="nx">pageLastIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">())[</span><span class="mi">1</span><span class="p">];</span>
    
                    <span class="c1">// At least one of the new records affects the view</span>
                    <span class="k">if</span> <span class="p">((</span><span class="nx">startIndex</span> <span class="o">&gt;=</span> <span class="nx">pageStartIndex</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">lastIndex</span> <span class="o">&lt;=</span> <span class="nx">pageLastIndex</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                    <span class="p">}</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowsAddEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">newRecords</span><span class="o">:</span><span class="nx">aNewRecords</span><span class="p">,</span> <span class="nx">oldRecords</span><span class="o">:</span><span class="nx">aOldRecords</span><span class="p">});</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Added &quot;</span> <span class="o">+</span> <span class="nx">aNewRecords</span><span class="p">.</span><span class="nx">length</span> <span class="o">+</span> 
                            <span class="s2">&quot; rows starting at index &quot;</span> <span class="o">+</span> <span class="nx">startIndex</span> <span class="o">+</span>
                            <span class="s2">&quot; with data &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">aData</span><span class="p">),</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="c1">// Not paginated</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// Update the TR elements</span>
                    <span class="kd">var</span> <span class="nx">loopN</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">),</span>
                        <span class="nx">rowCount</span> <span class="o">=</span> <span class="nx">aData</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="c1">// how many needed</span>
                        <span class="nx">isLast</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lastIndex</span> <span class="o">&gt;=</span> <span class="nx">lastRowIndex</span><span class="p">),</span>
                        <span class="nx">isAdding</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lastIndex</span> <span class="o">&gt;</span> <span class="nx">lastRowIndex</span><span class="p">);</span>
                                           
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                <span class="kd">var</span> <span class="nx">aRecords</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">aRecords</span><span class="p">,</span>
                                    <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span><span class="p">,</span>
                                    <span class="nx">j</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nDataPointer</span><span class="p">,</span>
                                    <span class="nx">len</span> <span class="o">=</span> <span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">i</span><span class="o">+</span><span class="nx">loopN</span><span class="p">,</span> <span class="nx">startIndex</span><span class="o">+</span><span class="nx">aRecords</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="o">:</span> <span class="nx">startIndex</span><span class="o">+</span><span class="nx">aRecords</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
                                    
                                <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span> <span class="o">&lt;</span> <span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">,</span><span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">isAdding</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">i</span><span class="o">&gt;=</span><span class="nx">lastRowIndex</span><span class="p">))</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_addTrEl</span><span class="p">(</span><span class="nx">aRecords</span><span class="p">[</span><span class="nx">j</span><span class="p">]));</span>
                                    <span class="p">}</span>
                                    <span class="k">else</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">_updateTrEl</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span> <span class="nx">aRecords</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                                <span class="nx">oArg</span><span class="p">.</span><span class="nx">nDataPointer</span> <span class="o">=</span> <span class="nx">j</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">},</span>
                        <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">rowCount</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
                        <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">nCurrentRow</span><span class="o">:</span><span class="nx">startIndex</span><span class="p">,</span><span class="nx">aRecords</span><span class="o">:</span><span class="nx">aNewRecords</span><span class="p">,</span><span class="nx">nDataPointer</span><span class="o">:</span><span class="mi">0</span><span class="p">,</span><span class="nx">isAdding</span><span class="o">:</span><span class="nx">isAdding</span><span class="p">},</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                    <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">recIndex</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">recIndex</span><span class="p">;</span>
                            <span class="c1">// Set FIRST/LAST</span>
                            <span class="k">if</span><span class="p">(</span><span class="nx">recIndex</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">_setFirstRow</span><span class="p">();</span>
                            <span class="p">}</span>
                            <span class="k">if</span><span class="p">(</span><span class="nx">oArg</span><span class="p">.</span><span class="nx">isLast</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">_setLastRow</span><span class="p">();</span>
                            <span class="p">}</span>
                            <span class="c1">// Set EVEN/ODD</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_setRowStripes</span><span class="p">();</span>                           
    
                            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowsAddEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">newRecords</span><span class="o">:</span><span class="nx">aNewRecords</span><span class="p">,</span> <span class="nx">oldRecords</span><span class="o">:</span><span class="nx">aOldRecords</span><span class="p">});</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Added &quot;</span> <span class="o">+</span> <span class="nx">aNewRecords</span><span class="p">.</span><span class="nx">length</span> <span class="o">+</span> 
                                    <span class="s2">&quot; rows starting at index &quot;</span> <span class="o">+</span> <span class="nx">startIndex</span> <span class="o">+</span>
                                    <span class="s2">&quot; with data &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">aData</span><span class="p">),</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                        <span class="p">},</span>
                        <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">recIndex</span><span class="o">:</span> <span class="nx">startIndex</span><span class="p">,</span> <span class="nx">isLast</span><span class="o">:</span> <span class="nx">isLast</span><span class="p">},</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="o">-</span><span class="mi">1</span> <span class="c1">// Needs to run immediately after the DOM insertions above</span>
                    <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">hideTableMessage</span><span class="p">();</span>                
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>            
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not update rows at &quot;</span> <span class="o">+</span> <span class="nx">startrow</span> <span class="o">+</span> <span class="s2">&quot; with &quot;</span> <span class="o">+</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">aData</span><span class="p">),</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Deletes the given row&#39;s Record from the RecordSet. If the row is on current page,</span>
<span class="cm"> * the corresponding DOM elements are also deleted.</span>
<span class="cm"> *</span>
<span class="cm"> * @method deleteRow</span>
<span class="cm"> * @param row {HTMLElement | String | Number} DOM element reference or ID string</span>
<span class="cm"> * to DataTable page element or RecordSet index.</span>
<span class="cm"> */</span>
<span class="nx">deleteRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nRecordIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="o">?</span> <span class="nx">row</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">nRecordIndex</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">nRecordIndex</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">nTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">nRecordIndex</span><span class="p">);</span>
            
            <span class="c1">// Remove from selection tracker if there</span>
            <span class="kd">var</span> <span class="nx">sRecordId</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>
            <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
            <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">((</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">))</span> <span class="o">||</span>
                        <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">)))</span> <span class="p">{</span>
                    <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">j</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
    
            <span class="c1">// Delete Record from RecordSet</span>
            <span class="kd">var</span> <span class="nx">oData</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">deleteRecord</span><span class="p">(</span><span class="nx">nRecordIndex</span><span class="p">);</span>
    
            <span class="c1">// Update the UI</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// If paginated and the deleted row was on this or a prior page, just</span>
                <span class="c1">// re-render</span>
                <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Update the paginator&#39;s totalRecords</span>
                    <span class="kd">var</span> <span class="nx">totalRecords</span> <span class="o">=</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">),</span>
                        <span class="c1">// must capture before the totalRecords change because</span>
                        <span class="c1">// Paginator shifts to previous page automatically</span>
                        <span class="nx">rng</span> <span class="o">=</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">();</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">totalRecords</span> <span class="o">!==</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Paginator</span><span class="p">.</span><span class="nx">VALUE_UNLIMITED</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">,</span><span class="nx">totalRecords</span> <span class="o">-</span> <span class="mi">1</span><span class="p">);</span>
                    <span class="p">}</span>
    
                    <span class="c1">// The deleted record was on this or a prior page, re-render</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">rng</span> <span class="o">||</span> <span class="nx">nRecordIndex</span> <span class="o">&lt;=</span> <span class="nx">rng</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                    <span class="p">}</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowDeleteEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">recordIndex</span><span class="o">:</span><span class="nx">nRecordIndex</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">trElIndex</span><span class="o">:</span><span class="nx">nTrIndex</span><span class="p">});</span>
                                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Deleted row with data &quot;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; at RecordSet index &quot;</span> <span class="o">+</span> <span class="nx">nRecordIndex</span> <span class="o">+</span> <span class="s2">&quot; and page row index &quot;</span> <span class="o">+</span> <span class="nx">nTrIndex</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>     
                            <span class="p">}</span>
                        <span class="p">},</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                    <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="c1">// Not paginated</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">nTrIndex</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                            <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                                <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="kd">var</span> <span class="nx">isLast</span> <span class="o">=</span> <span class="p">(</span><span class="nx">nRecordIndex</span> <span class="o">===</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getLength</span><span class="p">());</span><span class="c1">//(nTrIndex == this.getLastTrEl().sectionRowIndex);</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_deleteTrEl</span><span class="p">(</span><span class="nx">nTrIndex</span><span class="p">);</span>
                    
                                    <span class="c1">// Post-delete tasks</span>
                                    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="c1">// Set FIRST/LAST</span>
                                        <span class="k">if</span><span class="p">(</span><span class="nx">nTrIndex</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                                            <span class="k">this</span><span class="p">.</span><span class="nx">_setFirstRow</span><span class="p">();</span>
                                        <span class="p">}</span>
                                        <span class="k">if</span><span class="p">(</span><span class="nx">isLast</span><span class="p">)</span> <span class="p">{</span>
                                            <span class="k">this</span><span class="p">.</span><span class="nx">_setLastRow</span><span class="p">();</span>
                                        <span class="p">}</span>
                                        <span class="c1">// Set EVEN/ODD</span>
                                        <span class="k">if</span><span class="p">(</span><span class="nx">nTrIndex</span> <span class="o">!=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
                                            <span class="k">this</span><span class="p">.</span><span class="nx">_setRowStripes</span><span class="p">(</span><span class="nx">nTrIndex</span><span class="p">);</span>
                                        <span class="p">}</span>                                
                                    <span class="p">}</span>
                    
                                    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowDeleteEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">recordIndex</span><span class="o">:</span><span class="nx">nRecordIndex</span><span class="p">,</span><span class="nx">oldData</span><span class="o">:</span><span class="nx">oData</span><span class="p">,</span> <span class="nx">trElIndex</span><span class="o">:</span><span class="nx">nTrIndex</span><span class="p">});</span>
                                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Deleted row with data &quot;</span> <span class="o">+</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">oData</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot; at RecordSet index &quot;</span> <span class="o">+</span> <span class="nx">nRecordIndex</span> <span class="o">+</span> <span class="s2">&quot; and page row index &quot;</span> <span class="o">+</span> <span class="nx">nTrIndex</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>     
                                <span class="p">}</span>
                            <span class="p">},</span>
                            <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                            <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                        <span class="p">});</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                        <span class="k">return</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not delete row: &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Convenience method to delete multiple rows.</span>
<span class="cm"> *</span>
<span class="cm"> * @method deleteRows</span>
<span class="cm"> * @param row {HTMLElement | String | Number} DOM element reference or ID string</span>
<span class="cm"> * to DataTable page element or RecordSet index.</span>
<span class="cm"> * @param count {Number} (optional) How many rows to delete. A negative value</span>
<span class="cm"> * will delete towards the beginning.</span>
<span class="cm"> */</span>
<span class="nx">deleteRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">,</span> <span class="nx">count</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nRecordIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="o">?</span> <span class="nx">row</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">nRecordIndex</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">nRecordIndex</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">nTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">nRecordIndex</span><span class="p">);</span>
            
            <span class="c1">// Remove from selection tracker if there</span>
            <span class="kd">var</span> <span class="nx">sRecordId</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>
            <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
            <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">((</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">))</span> <span class="o">||</span>
                        <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">)))</span> <span class="p">{</span>
                    <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">j</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
    
            <span class="c1">// Delete Record from RecordSet</span>
            <span class="kd">var</span> <span class="nx">highIndex</span> <span class="o">=</span> <span class="nx">nRecordIndex</span><span class="p">;</span>
            <span class="kd">var</span> <span class="nx">lowIndex</span> <span class="o">=</span> <span class="nx">nRecordIndex</span><span class="p">;</span>
        
            <span class="c1">// Validate count and account for negative value</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">count</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">count</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">highIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">count</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nx">nRecordIndex</span> <span class="o">+</span> <span class="nx">count</span> <span class="o">-</span><span class="mi">1</span> <span class="o">:</span> <span class="nx">nRecordIndex</span><span class="p">;</span>
                <span class="nx">lowIndex</span> <span class="o">=</span> <span class="p">(</span><span class="nx">count</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nx">nRecordIndex</span> <span class="o">:</span> <span class="nx">nRecordIndex</span> <span class="o">+</span> <span class="nx">count</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
                <span class="nx">count</span> <span class="o">=</span> <span class="p">(</span><span class="nx">count</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nx">count</span> <span class="o">:</span> <span class="nx">count</span><span class="o">*-</span><span class="mi">1</span><span class="p">;</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">lowIndex</span> <span class="o">&lt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">lowIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
                    <span class="nx">count</span> <span class="o">=</span> <span class="nx">highIndex</span> <span class="o">-</span> <span class="nx">lowIndex</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">count</span> <span class="o">=</span> <span class="mi">1</span><span class="p">;</span>
            <span class="p">}</span>
            
            <span class="kd">var</span> <span class="nx">aData</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">deleteRecords</span><span class="p">(</span><span class="nx">lowIndex</span><span class="p">,</span> <span class="nx">count</span><span class="p">);</span>
    
            <span class="c1">// Update the UI</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">aData</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">),</span>
                    <span class="nx">loopN</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">);</span>
                <span class="c1">// If paginated and the deleted row was on this or a prior page, just</span>
                <span class="c1">// re-render</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Update the paginator&#39;s totalRecords</span>
                    <span class="kd">var</span> <span class="nx">totalRecords</span> <span class="o">=</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">),</span>
                        <span class="c1">// must capture before the totalRecords change because</span>
                        <span class="c1">// Paginator shifts to previous page automatically</span>
                        <span class="nx">rng</span> <span class="o">=</span> <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">getPageRecords</span><span class="p">();</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">totalRecords</span> <span class="o">!==</span> <span class="nx">widget</span><span class="p">.</span><span class="nx">Paginator</span><span class="p">.</span><span class="nx">VALUE_UNLIMITED</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">,</span><span class="nx">totalRecords</span> <span class="o">-</span> <span class="nx">aData</span><span class="p">.</span><span class="nx">length</span><span class="p">);</span>
                    <span class="p">}</span>
    
                    <span class="c1">// The records were on this or a prior page, re-render</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">rng</span> <span class="o">||</span> <span class="nx">lowIndex</span> <span class="o">&lt;=</span> <span class="nx">rng</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                    <span class="p">}</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                        <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowsDeleteEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">recordIndex</span><span class="o">:</span><span class="nx">lowIndex</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">aData</span><span class="p">,</span> <span class="nx">count</span><span class="o">:</span><span class="nx">count</span><span class="p">});</span>
                                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable &quot;</span> <span class="o">+</span> <span class="nx">count</span> <span class="o">+</span> <span class="s2">&quot; rows deleted starting at index &quot;</span> <span class="o">+</span> <span class="nx">lowIndex</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                            <span class="p">}</span>
                        <span class="p">},</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                    <span class="p">});</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>
                <span class="c1">// Not paginated</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">nTrIndex</span><span class="p">))</span> <span class="p">{</span>
                        <span class="c1">// Delete the TR elements starting with highest index</span>
                        <span class="kd">var</span> <span class="nx">loopEnd</span> <span class="o">=</span> <span class="nx">lowIndex</span><span class="p">;</span>
                        <span class="kd">var</span> <span class="nx">nRowsNeeded</span> <span class="o">=</span> <span class="nx">count</span><span class="p">;</span> <span class="c1">// how many needed</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                            <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArg</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span><span class="p">,</span>
                                        <span class="nx">len</span> <span class="o">=</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="p">(</span><span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">i</span> <span class="o">-</span> <span class="nx">loopN</span><span class="p">,</span><span class="nx">loopEnd</span><span class="p">)</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">:</span> <span class="nx">loopEnd</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span>
                                    <span class="k">for</span><span class="p">(;</span> <span class="nx">i</span><span class="o">&gt;</span><span class="nx">len</span><span class="p">;</span> <span class="o">--</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">_deleteTrEl</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                                    <span class="p">}</span>
                                    <span class="nx">oArg</span><span class="p">.</span><span class="nx">nCurrentRow</span> <span class="o">=</span> <span class="nx">i</span><span class="p">;</span>
                                <span class="p">}</span>
                            <span class="p">},</span>
                            <span class="nx">iterations</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">ceil</span><span class="p">(</span><span class="nx">count</span><span class="o">/</span><span class="nx">loopN</span><span class="p">)</span> <span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
                            <span class="nx">argument</span><span class="o">:</span> <span class="p">{</span><span class="nx">nCurrentRow</span><span class="o">:</span><span class="nx">highIndex</span><span class="p">},</span>
                            <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                            <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="nx">loopN</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
                        <span class="p">});</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                            <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>    
                                <span class="c1">// Post-delete tasks</span>
                                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">rows</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_setFirstRow</span><span class="p">();</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_setLastRow</span><span class="p">();</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_setRowStripes</span><span class="p">();</span>
                                <span class="p">}</span>
                                
                                <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowsDeleteEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">recordIndex</span><span class="o">:</span><span class="nx">lowIndex</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">aData</span><span class="p">,</span> <span class="nx">count</span><span class="o">:</span><span class="nx">count</span><span class="p">});</span>
                                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable &quot;</span> <span class="o">+</span> <span class="nx">count</span> <span class="o">+</span> <span class="s2">&quot; rows deleted starting at index &quot;</span> <span class="o">+</span> <span class="nx">lowIndex</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                            <span class="p">},</span>
                            <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                            <span class="nx">timeout</span><span class="o">:</span> <span class="o">-</span><span class="mi">1</span> <span class="c1">// Needs to run immediately after the DOM deletions above</span>
                        <span class="p">});</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
                        <span class="k">return</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not delete &quot;</span> <span class="o">+</span> <span class="nx">count</span> <span class="o">+</span> <span class="s2">&quot; rows at row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
<span class="p">},</span>














































<span class="c1">// CELL FUNCTIONS</span>

<span class="cm">/**</span>
<span class="cm"> * Outputs markup into the given TD based on given Record.</span>
<span class="cm"> *</span>
<span class="cm"> * @method formatCell</span>
<span class="cm"> * @param elLiner {HTMLElement} The liner DIV element within the TD.</span>
<span class="cm"> * @param oRecord {YAHOO.widget.Record} (Optional) Record instance.</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} (Optional) Column instance.</span>
<span class="cm"> */</span>
<span class="nx">formatCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elLiner</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elLiner</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elLiner</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">));</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">sField</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">field</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">oData</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getData</span><span class="p">(</span><span class="nx">sField</span><span class="p">);</span>

        <span class="kd">var</span> <span class="nx">fnFormatter</span> <span class="o">=</span> <span class="k">typeof</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">formatter</span> <span class="o">===</span> <span class="s1">&#39;function&#39;</span> <span class="o">?</span>
                          <span class="nx">oColumn</span><span class="p">.</span><span class="nx">formatter</span> <span class="o">:</span>
                          <span class="nx">DT</span><span class="p">.</span><span class="nx">Formatter</span><span class="p">[</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">formatter</span><span class="o">+</span><span class="s1">&#39;&#39;</span><span class="p">]</span> <span class="o">||</span>
                          <span class="nx">DT</span><span class="p">.</span><span class="nx">Formatter</span><span class="p">.</span><span class="nx">defaultFormatter</span><span class="p">;</span>

        <span class="c1">// Apply special formatter</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">fnFormatter</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">fnFormatter</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">elLiner</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">elLiner</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="nx">oData</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellFormatEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">key</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elLiner</span><span class="p">});</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not format cell &quot;</span> <span class="o">+</span> <span class="nx">elLiner</span><span class="p">,</span> <span class="s2">&quot;error&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * For the given row and column, updates the Record with the given data. If the</span>
<span class="cm"> * cell is on current page, the corresponding DOM elements are also updated.</span>
<span class="cm"> *</span>
<span class="cm"> * @method updateCell</span>
<span class="cm"> * @param oRecord {YAHOO.widget.Record} Record instance.</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column | String | Number} A Column key, or a ColumnSet key index.</span>
<span class="cm"> * @param oData {Object} New data value for the cell.</span>
<span class="cm"> * @param skipRender {Boolean} Skips render step. Editors that update multiple</span>
<span class="cm"> * cells in ScrollingDataTable should render only on the last call to updateCell().</span>
<span class="cm"> */</span>
<span class="nx">updateCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oData</span><span class="p">,</span> <span class="nx">skipRender</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Validate Column and Record</span>
    <span class="nx">oColumn</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">)</span> <span class="o">?</span> <span class="nx">oColumn</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getField</span><span class="p">()</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oRecord</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">sKey</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getField</span><span class="p">(),</span>
        
        <span class="c1">// Copy data from the Record for the event that gets fired later</span>
        <span class="c1">//var oldData = YAHOO.widget.DataTable._cloneObject(oRecord.getData());</span>
            <span class="nx">oldData</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getData</span><span class="p">(</span><span class="nx">sKey</span><span class="p">);</span>

        <span class="c1">// Update Record with new data</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">updateRecordValue</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">sKey</span><span class="p">,</span> <span class="nx">oData</span><span class="p">);</span>
    
        <span class="c1">// Update the TD only if row is on current page</span>
        <span class="kd">var</span> <span class="nx">elTd</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">({</span><span class="nx">record</span><span class="o">:</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span> <span class="nx">oColumn</span><span class="p">});</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elTd</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">formatCell</span><span class="p">(</span><span class="nx">elTd</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellUpdateEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">oldData</span><span class="p">});</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable cell updated: Record ID = &quot;</span> <span class="o">+</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span>
                                <span class="s2">&quot;, Record index = &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="o">+</span>
                                <span class="s2">&quot;, page row index = &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="o">+</span>
                                <span class="s2">&quot;, Column key = &quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKey</span><span class="p">(),</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                    <span class="p">}</span>
                <span class="p">},</span>
                <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span><span class="p">,</span>
                <span class="nx">timeout</span><span class="o">:</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;renderLoopSize&quot;</span><span class="p">)</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="o">?</span> <span class="mi">0</span> <span class="o">:</span> <span class="o">-</span><span class="mi">1</span>
            <span class="p">});</span>
            <span class="c1">// Bug 2529024</span>
            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">skipRender</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_runRenderChain</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellUpdateEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">oldData</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;DataTable cell updated: Record ID = &quot;</span> <span class="o">+</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">()</span> <span class="o">+</span>
                    <span class="s2">&quot;, Record index = &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="o">+</span>
                    <span class="s2">&quot;, page row index = &quot;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="o">+</span>
                    <span class="s2">&quot;, Column key = &quot;</span> <span class="o">+</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKey</span><span class="p">(),</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>   
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>



















































<span class="c1">// PAGINATION</span>
<span class="cm">/**</span>
<span class="cm"> * Method executed during set() operation for the &quot;paginator&quot; attribute.</span>
<span class="cm"> * Adds and/or severs event listeners between DataTable and Paginator</span>
<span class="cm"> *</span>
<span class="cm"> * @method _updatePaginator</span>
<span class="cm"> * @param newPag {Paginator} Paginator instance (or null) for DataTable to use</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_updatePaginator</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">newPag</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oldPag</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">oldPag</span> <span class="o">&amp;&amp;</span> <span class="nx">newPag</span> <span class="o">!==</span> <span class="nx">oldPag</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oldPag</span><span class="p">.</span><span class="nx">unsubscribe</span><span class="p">(</span><span class="s1">&#39;changeRequest&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">onPaginatorChangeRequest</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">newPag</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">newPag</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s1">&#39;changeRequest&#39;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">onPaginatorChangeRequest</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Update the UI infrastructure in response to a &quot;paginator&quot; attribute change.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handlePaginatorChange</span>
<span class="cm"> * @param e {Object} Change event object containing keys &#39;type&#39;,&#39;newValue&#39;,</span>
<span class="cm"> *                   and &#39;prevValue&#39;</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handlePaginatorChange</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">e</span><span class="p">.</span><span class="nx">prevValue</span> <span class="o">===</span> <span class="nx">e</span><span class="p">.</span><span class="nx">newValue</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span>

    <span class="kd">var</span> <span class="nx">newPag</span>     <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">newValue</span><span class="p">,</span>
        <span class="nx">oldPag</span>     <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">prevValue</span><span class="p">,</span>
        <span class="nx">containers</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_defaultPaginatorContainers</span><span class="p">();</span>

    <span class="k">if</span> <span class="p">(</span><span class="nx">oldPag</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span> <span class="p">(</span><span class="nx">oldPag</span><span class="p">.</span><span class="nx">getContainerNodes</span><span class="p">()[</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="nx">containers</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">{</span>
            <span class="nx">oldPag</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;containers&#39;</span><span class="p">,[]);</span>
        <span class="p">}</span>
        <span class="nx">oldPag</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>

        <span class="c1">// Convenience: share the default containers if possible.</span>
        <span class="c1">// Otherwise, remove the default containers from the DOM.</span>
        <span class="k">if</span> <span class="p">(</span><span class="nx">containers</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">newPag</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">newPag</span><span class="p">.</span><span class="nx">getContainerNodes</span><span class="p">().</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">newPag</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;containers&#39;</span><span class="p">,</span><span class="nx">containers</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// No new Paginator to use existing containers, OR new</span>
                <span class="c1">// Paginator has configured containers.</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="o">=</span> <span class="nx">containers</span><span class="p">.</span><span class="nx">length</span> <span class="o">-</span> <span class="mi">1</span><span class="p">;</span> <span class="nx">i</span> <span class="o">&gt;=</span> <span class="mi">0</span><span class="p">;</span> <span class="o">--</span><span class="nx">i</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="p">{</span>
                        <span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">parentNode</span><span class="p">.</span><span class="nx">removeChild</span><span class="p">(</span><span class="nx">containers</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_bInit</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>

    <span class="p">}</span>

    <span class="k">if</span> <span class="p">(</span><span class="nx">newPag</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">renderPaginator</span><span class="p">();</span>
    <span class="p">}</span>

<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns the default containers used for Paginators.  If create param is</span>
<span class="cm"> * passed, the containers will be created and added to the DataTable container.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _defaultPaginatorContainers</span>
<span class="cm"> * @param create {boolean} Create the default containers if not found</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_defaultPaginatorContainers</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">create</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">above_id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">+</span> <span class="s1">&#39;-paginator0&#39;</span><span class="p">,</span>
        <span class="nx">below_id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">+</span> <span class="s1">&#39;-paginator1&#39;</span><span class="p">,</span>
        <span class="nx">above</span>    <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">above_id</span><span class="p">),</span>
        <span class="nx">below</span>    <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="nx">below_id</span><span class="p">);</span>

    <span class="k">if</span> <span class="p">(</span><span class="nx">create</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="nx">above</span> <span class="o">||</span> <span class="o">!</span><span class="nx">below</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// One above and one below the table</span>
        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">above</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">above</span>    <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
            <span class="nx">above</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">above_id</span><span class="p">;</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">above</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_PAGINATOR</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">above</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">below</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">below</span>    <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s1">&#39;div&#39;</span><span class="p">);</span>
            <span class="nx">below</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="nx">below_id</span><span class="p">;</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">below</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_PAGINATOR</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">_elContainer</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">below</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="k">return</span> <span class="p">[</span><span class="nx">above</span><span class="p">,</span><span class="nx">below</span><span class="p">];</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Calls Paginator&#39;s destroy() method</span>
<span class="cm"> *</span>
<span class="cm"> * @method _destroyPaginator</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_destroyPaginator</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oldPag</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
    <span class="k">if</span> <span class="p">(</span><span class="nx">oldPag</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oldPag</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Renders the Paginator to the DataTable UI</span>
<span class="cm"> *</span>
<span class="cm"> * @method renderPaginator</span>
<span class="cm"> */</span>
<span class="nx">renderPaginator</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">pag</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;paginator&quot;</span><span class="p">);</span>
    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">pag</span><span class="p">)</span> <span class="p">{</span> <span class="k">return</span><span class="p">;</span> <span class="p">}</span>

    <span class="c1">// Add the containers if the Paginator is not configured with containers</span>
    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">pag</span><span class="p">.</span><span class="nx">getContainerNodes</span><span class="p">().</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">pag</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;containers&#39;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_defaultPaginatorContainers</span><span class="p">(</span><span class="kc">true</span><span class="p">));</span>
    <span class="p">}</span>

    <span class="nx">pag</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Overridable method gives implementers a hook to show loading message before</span>
<span class="cm"> * changing Paginator value.</span>
<span class="cm"> *</span>
<span class="cm"> * @method doBeforePaginatorChange</span>
<span class="cm"> * @param oPaginatorState {Object} An object literal describing the proposed pagination state.</span>
<span class="cm"> * @return {Boolean} Return true to continue changing Paginator value.</span>
<span class="cm"> */</span>
<span class="nx">doBeforePaginatorChange</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oPaginatorState</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_LOADING&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_LOADING</span><span class="p">);</span>
    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Responds to new Pagination states. By default, updates the UI to reflect the</span>
<span class="cm"> * new state. If &quot;dynamicData&quot; is true, current selections are purged before</span>
<span class="cm"> * a request is sent to the DataSource for data for the new state (using the</span>
<span class="cm"> * request returned by &quot;generateRequest()&quot;).</span>
<span class="cm"> *  </span>
<span class="cm"> * @method onPaginatorChangeRequest</span>
<span class="cm"> * @param oPaginatorState {Object} An object literal describing the proposed pagination state.</span>
<span class="cm"> */</span>
<span class="nx">onPaginatorChangeRequest</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oPaginatorState</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforePaginatorChange</span><span class="p">(</span><span class="nx">oPaginatorState</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">ok</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Server-side pagination</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;dynamicData&quot;</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// Get the current state</span>
            <span class="kd">var</span> <span class="nx">oState</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getState</span><span class="p">();</span>
            
            <span class="c1">// Update pagination values</span>
            <span class="nx">oState</span><span class="p">.</span><span class="nx">pagination</span> <span class="o">=</span> <span class="nx">oPaginatorState</span><span class="p">;</span>
    
            <span class="c1">// Get the request for the new state</span>
            <span class="kd">var</span> <span class="nx">request</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;generateRequest&quot;</span><span class="p">)(</span><span class="nx">oState</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
            
            <span class="c1">// Purge selections</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllRows</span><span class="p">();</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllCells</span><span class="p">();</span>
            
            <span class="c1">// Get the new data from the server</span>
            <span class="kd">var</span> <span class="nx">callback</span> <span class="o">=</span> <span class="p">{</span>
                <span class="nx">success</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">,</span>
                <span class="nx">failure</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">,</span>
                <span class="nx">argument</span> <span class="o">:</span> <span class="nx">oState</span><span class="p">,</span> <span class="c1">// Pass along the new state to the callback</span>
                <span class="nx">scope</span> <span class="o">:</span> <span class="k">this</span>
            <span class="p">};</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oDataSource</span><span class="p">.</span><span class="nx">sendRequest</span><span class="p">(</span><span class="nx">request</span><span class="p">,</span> <span class="nx">callback</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// Client-side pagination</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="c1">// Set the core pagination values silently (the second param)</span>
            <span class="c1">// to avoid looping back through the changeRequest mechanism</span>
            <span class="nx">oPaginatorState</span><span class="p">.</span><span class="nx">paginator</span><span class="p">.</span><span class="nx">setStartIndex</span><span class="p">(</span><span class="nx">oPaginatorState</span><span class="p">.</span><span class="nx">recordOffset</span><span class="p">,</span><span class="kc">true</span><span class="p">);</span>
            <span class="nx">oPaginatorState</span><span class="p">.</span><span class="nx">paginator</span><span class="p">.</span><span class="nx">setRowsPerPage</span><span class="p">(</span><span class="nx">oPaginatorState</span><span class="p">.</span><span class="nx">rowsPerPage</span><span class="p">,</span><span class="kc">true</span><span class="p">);</span>
    
            <span class="c1">// Update the UI</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not change Paginator value \&quot;&quot;</span> <span class="o">+</span> <span class="nx">oPaginatorState</span> <span class="o">+</span> <span class="s2">&quot;\&quot;&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>


















































<span class="c1">// SELECTION/HIGHLIGHTING</span>

<span class="cm">/*</span>
<span class="cm"> * Reference to last highlighted cell element</span>
<span class="cm"> *</span>
<span class="cm"> * @property _elLastHighlightedTd</span>
<span class="cm"> * @type HTMLElement</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_elLastHighlightedTd</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/*</span>
<span class="cm"> * ID string of last highlighted row element</span>
<span class="cm"> *</span>
<span class="cm"> * @property _sLastHighlightedTrElId</span>
<span class="cm"> * @type String</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="c1">//_sLastHighlightedTrElId : null,</span>

<span class="cm">/**</span>
<span class="cm"> * Array to track row selections (by sRecordId) and/or cell selections</span>
<span class="cm"> * (by {recordId:sRecordId, columnKey:sColumnKey})</span>
<span class="cm"> *</span>
<span class="cm"> * @property _aSelections</span>
<span class="cm"> * @type Object[]</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_aSelections</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Record instance of the row selection anchor.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _oAnchorRecord</span>
<span class="cm"> * @type YAHOO.widget.Record</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_oAnchorRecord</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Object literal representing cell selection anchor:</span>
<span class="cm"> * {recordId:sRecordId, columnKey:sColumnKey}.</span>
<span class="cm"> *</span>
<span class="cm"> * @property _oAnchorCell</span>
<span class="cm"> * @type Object</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_oAnchorCell</span> <span class="o">:</span> <span class="kc">null</span><span class="p">,</span>

<span class="cm">/**</span>
<span class="cm"> * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED</span>
<span class="cm"> * from all TR elements on the page.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _unselectAllTrEls</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_unselectAllTrEls</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">selectedRows</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">,</span><span class="s2">&quot;tr&quot;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">);</span>
    <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">selectedRows</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns object literal of values that represent the selection trigger. Used</span>
<span class="cm"> * to determine selection behavior resulting from a key event.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _getSelectionTrigger</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_getSelectionTrigger</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sMode</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;selectionMode&quot;</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">oTrigger</span> <span class="o">=</span> <span class="p">{};</span>
    <span class="kd">var</span> <span class="nx">oTriggerCell</span><span class="p">,</span> <span class="nx">oTriggerRecord</span><span class="p">,</span> <span class="nx">nTriggerRecordIndex</span><span class="p">,</span> <span class="nx">elTriggerRow</span><span class="p">,</span> <span class="nx">nTriggerTrIndex</span><span class="p">;</span>

    <span class="c1">// Cell mode</span>
    <span class="k">if</span><span class="p">((</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellblock&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellrange&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;singlecell&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oTriggerCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getLastSelectedCell</span><span class="p">();</span>
        <span class="c1">// No selected cells found</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oTriggerCell</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="nx">oTriggerRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">oTriggerCell</span><span class="p">.</span><span class="nx">recordId</span><span class="p">);</span>
            <span class="nx">nTriggerRecordIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oTriggerRecord</span><span class="p">);</span>
            <span class="nx">elTriggerRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">oTriggerRecord</span><span class="p">);</span>
            <span class="nx">nTriggerTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">elTriggerRow</span><span class="p">);</span>

            <span class="c1">// Selected cell not found on this page</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">nTriggerTrIndex</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">record</span> <span class="o">=</span> <span class="nx">oTriggerRecord</span><span class="p">;</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">=</span> <span class="nx">nTriggerRecordIndex</span><span class="p">;</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">oTriggerCell</span><span class="p">);</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span> <span class="o">=</span> <span class="nx">nTriggerTrIndex</span><span class="p">;</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">column</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">oTriggerCell</span><span class="p">.</span><span class="nx">columnKey</span><span class="p">);</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">column</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">cell</span> <span class="o">=</span> <span class="nx">oTriggerCell</span><span class="p">;</span>
                <span class="k">return</span> <span class="nx">oTrigger</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="c1">// Row mode</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">oTriggerRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getLastSelectedRecord</span><span class="p">();</span>
        <span class="c1">// No selected rows found</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oTriggerRecord</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="c1">// Selected row found, but is it on current page?</span>
            <span class="nx">oTriggerRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">oTriggerRecord</span><span class="p">);</span>
            <span class="nx">nTriggerRecordIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oTriggerRecord</span><span class="p">);</span>
            <span class="nx">elTriggerRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">oTriggerRecord</span><span class="p">);</span>
            <span class="nx">nTriggerTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">elTriggerRow</span><span class="p">);</span>

            <span class="c1">// Selected row not found on this page</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">nTriggerTrIndex</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">record</span> <span class="o">=</span> <span class="nx">oTriggerRecord</span><span class="p">;</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">=</span> <span class="nx">nTriggerRecordIndex</span><span class="p">;</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span> <span class="o">=</span> <span class="nx">elTriggerRow</span><span class="p">;</span>
                <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span> <span class="o">=</span> <span class="nx">nTriggerTrIndex</span><span class="p">;</span>
                <span class="k">return</span> <span class="nx">oTrigger</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns object literal of values that represent the selection anchor. Used</span>
<span class="cm"> * to determine selection behavior resulting from a user event.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _getSelectionAnchor</span>
<span class="cm"> * @param oTrigger {Object} (Optional) Object literal of selection trigger values</span>
<span class="cm"> * (for key events).</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_getSelectionAnchor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sMode</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;selectionMode&quot;</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="p">{};</span>
    <span class="kd">var</span> <span class="nx">oAnchorRecord</span><span class="p">,</span> <span class="nx">nAnchorRecordIndex</span><span class="p">,</span> <span class="nx">nAnchorTrIndex</span><span class="p">;</span>

    <span class="c1">// Cell mode</span>
    <span class="k">if</span><span class="p">((</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellblock&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellrange&quot;</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;singlecell&quot;</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Validate anchor cell</span>
        <span class="kd">var</span> <span class="nx">oAnchorCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oAnchorCell</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">oAnchorCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">cell</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="nx">oAnchorRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">.</span><span class="nx">record</span><span class="p">;</span>
        <span class="nx">nAnchorRecordIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oAnchorRecord</span><span class="p">);</span>
        <span class="nx">nAnchorTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">oAnchorRecord</span><span class="p">);</span>
        <span class="c1">// If anchor cell is not on this page...</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nAnchorTrIndex</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// ...set TR index equal to top TR</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">nAnchorRecordIndex</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getFirstTrEl</span><span class="p">()))</span> <span class="p">{</span>
                <span class="nx">nAnchorTrIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="c1">// ...set TR index equal to bottom TR</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">nAnchorTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getLastTrEl</span><span class="p">());</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">record</span> <span class="o">=</span> <span class="nx">oAnchorRecord</span><span class="p">;</span>
        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">=</span> <span class="nx">nAnchorRecordIndex</span><span class="p">;</span>
        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span> <span class="o">=</span> <span class="nx">nAnchorTrIndex</span><span class="p">;</span>
        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">column</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">.</span><span class="nx">column</span><span class="p">;</span>
        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">column</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">cell</span> <span class="o">=</span> <span class="nx">oAnchorCell</span><span class="p">;</span>
        <span class="k">return</span> <span class="nx">oAnchor</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Row mode</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">oAnchorRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oAnchorRecord</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">oAnchorRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">record</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="nx">nAnchorRecordIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oAnchorRecord</span><span class="p">);</span>
        <span class="nx">nAnchorTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">oAnchorRecord</span><span class="p">);</span>
        <span class="c1">// If anchor row is not on this page...</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nAnchorTrIndex</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// ...set TR index equal to top TR</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">nAnchorRecordIndex</span> <span class="o">&lt;</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getFirstTrEl</span><span class="p">()))</span> <span class="p">{</span>
                <span class="nx">nAnchorTrIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="c1">// ...set TR index equal to bottom TR</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">nAnchorTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getLastTrEl</span><span class="p">());</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">record</span> <span class="o">=</span> <span class="nx">oAnchorRecord</span><span class="p">;</span>
        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">=</span> <span class="nx">nAnchorRecordIndex</span><span class="p">;</span>
        <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span> <span class="o">=</span> <span class="nx">nAnchorTrIndex</span><span class="p">;</span>
        <span class="k">return</span> <span class="nx">oAnchor</span><span class="p">;</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a mouse event when selection mode</span>
<span class="cm"> * is set to &quot;standard&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleStandardSelectionByMouse</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleStandardSelectionByMouse</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">;</span>

    <span class="c1">// Validate target row</span>
    <span class="kd">var</span> <span class="nx">elTargetRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">e</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">event</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">bSHIFT</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">bCTRL</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">ctrlKey</span> <span class="o">||</span> <span class="p">((</span><span class="nx">navigator</span><span class="p">.</span><span class="nx">userAgent</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s2">&quot;mac&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">e</span><span class="p">.</span><span class="nx">metaKey</span><span class="p">);</span>

        <span class="kd">var</span> <span class="nx">oTargetRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">nTargetRecordIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>

        <span class="kd">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionAnchor</span><span class="p">();</span>

        <span class="kd">var</span> <span class="nx">i</span><span class="p">;</span>

        <span class="c1">// Both SHIFT and CTRL</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bSHIFT</span> <span class="o">&amp;&amp;</span> <span class="nx">bCTRL</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Validate anchor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">record</span><span class="p">))</span> <span class="p">{</span>
                    <span class="c1">// Select all rows between anchor row and target row, including target row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetRecordIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Select all rows between target row and anchor row, including target row</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">nTargetRecordIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// Unselect all rows between anchor row and target row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetRecordIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">unselectRow</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Unselect all rows between target row and anchor row</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetRecordIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">unselectRow</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Select the target row</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Invalid anchor</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Set anchor</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">oTargetRecord</span><span class="p">;</span>

                <span class="c1">// Toggle selection of target</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectRow</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
         <span class="c1">// Only SHIFT</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">bSHIFT</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllRows</span><span class="p">();</span>

            <span class="c1">// Validate anchor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select all rows between anchor row and target row,</span>
                <span class="c1">// including the anchor row and target row</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetRecordIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Select all rows between target row and anchor row,</span>
                <span class="c1">// including the target row and anchor row</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">nTargetRecordIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Invalid anchor</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Set anchor</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">oTargetRecord</span><span class="p">;</span>

                <span class="c1">// Select target row only</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Only CTRL</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">bCTRL</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Set anchor</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">oTargetRecord</span><span class="p">;</span>

            <span class="c1">// Toggle selection of target</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectRow</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Neither SHIFT nor CTRL</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a key event when selection mode</span>
<span class="cm"> * is set to &quot;standard&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleStandardSelectionByKey</span>
<span class="cm"> * @param e {HTMLEvent} Event object.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleStandardSelectionByKey</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nKey</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>

    <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">38</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">40</span><span class="p">))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">bSHIFT</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">;</span>

        <span class="c1">// Validate trigger</span>
        <span class="kd">var</span> <span class="nx">oTrigger</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionTrigger</span><span class="p">();</span>
        <span class="c1">// Arrow selection only works if last selected row is on current page</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="nx">Ev</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>

        <span class="c1">// Validate anchor</span>
        <span class="kd">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionAnchor</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">);</span>

        <span class="c1">// Determine which direction we&#39;re going to</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bSHIFT</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Selecting down away from anchor row</span>
            <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">40</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getNextTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">));</span>
            <span class="p">}</span>
            <span class="c1">// Selecting up away from anchor row</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">38</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&gt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">));</span>
            <span class="p">}</span>
            <span class="c1">// Unselect trigger</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectRow</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a mouse event when selection mode</span>
<span class="cm"> * is set to &quot;single&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleSingleSelectionByMouse</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleSingleSelectionByMouse</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">;</span>

    <span class="c1">// Validate target row</span>
    <span class="kd">var</span> <span class="nx">elTargetRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oTargetRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">);</span>

        <span class="c1">// Set anchor</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">oTargetRecord</span><span class="p">;</span>

        <span class="c1">// Select only target</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllRows</span><span class="p">();</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a key event when selection mode</span>
<span class="cm"> * is set to &quot;single&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleSingleSelectionByKey</span>
<span class="cm"> * @param e {HTMLEvent} Event object.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleSingleSelectionByKey</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nKey</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>

    <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">38</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">40</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Validate trigger</span>
        <span class="kd">var</span> <span class="nx">oTrigger</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionTrigger</span><span class="p">();</span>
        <span class="c1">// Arrow selection only works if last selected row is on current page</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="nx">Ev</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>

        <span class="c1">// Determine the new row to select</span>
        <span class="kd">var</span> <span class="nx">elNew</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">38</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// arrow up</span>
            <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Validate new row</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNew</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//TODO: wrap around to last tr on current page</span>
                <span class="c1">//elNew = this.getLastTrEl();</span>

                <span class="c1">//TODO: wrap back to last tr of previous page</span>

                <span class="c1">// Top row selection is sticky</span>
                <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getFirstTrEl</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">40</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// arrow down</span>
            <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getNextTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Validate new row</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNew</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//TODO: wrap around to first tr on current page</span>
                <span class="c1">//elNew = this.getFirstTrEl();</span>

                <span class="c1">//TODO: wrap forward to first tr of previous page</span>

                <span class="c1">// Bottom row selection is sticky</span>
                <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getLastTrEl</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="c1">// Unselect all rows</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllRows</span><span class="p">();</span>

        <span class="c1">// Select the new row</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>

        <span class="c1">// Set new anchor</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a mouse event when selection mode</span>
<span class="cm"> * is set to &quot;cellblock&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleCellBlockSelectionByMouse</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleCellBlockSelectionByMouse</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">;</span>

    <span class="c1">// Validate target cell</span>
    <span class="kd">var</span> <span class="nx">elTargetCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">e</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">event</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">bSHIFT</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">bCTRL</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">ctrlKey</span> <span class="o">||</span> <span class="p">((</span><span class="nx">navigator</span><span class="p">.</span><span class="nx">userAgent</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s2">&quot;mac&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">e</span><span class="p">.</span><span class="nx">metaKey</span><span class="p">);</span>

        <span class="kd">var</span> <span class="nx">elTargetRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">nTargetTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oTargetColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">nTargetColKeyIndex</span> <span class="o">=</span> <span class="nx">oTargetColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
        <span class="kd">var</span> <span class="nx">oTargetRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">nTargetRecordIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oTargetCell</span> <span class="o">=</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oTargetRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oTargetColumn</span><span class="p">};</span>

        <span class="kd">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionAnchor</span><span class="p">();</span>

        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">startIndex</span><span class="p">,</span> <span class="nx">endIndex</span><span class="p">,</span> <span class="nx">currentRow</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">j</span><span class="p">;</span>

        <span class="c1">// Both SHIFT and CTRL</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bSHIFT</span> <span class="o">&amp;&amp;</span> <span class="nx">bCTRL</span><span class="p">)</span> <span class="p">{</span>

            <span class="c1">// Validate anchor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Anchor is selected</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">cell</span><span class="p">))</span> <span class="p">{</span>
                    <span class="c1">// All cells are on the same row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">===</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Select all cells between anchor cell and target cell, including target cell</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="c1">// Select all cells between target cell and anchor cell, including target cell</span>
                        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nTargetColKeyIndex</span> <span class="o">&lt;</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is above target row</span>
                    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>
                        <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>

                        <span class="c1">// Select all cells from startIndex to endIndex on rows between anchor row and target row</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is below target row</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>
                        <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>

                        <span class="c1">// Select all cells from startIndex to endIndex on rows between target row and anchor row</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Anchor cell is unselected</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// All cells are on the same row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">===</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Unselect all cells between anchor cell and target cell</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="c1">// Select all cells between target cell and anchor cell</span>
                        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nTargetColKeyIndex</span> <span class="o">&lt;</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetColKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is above target row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Unselect all cells from anchor cell to target cell</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">currentRow</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="c1">// This is the anchor row, only unselect cells after the anchor cell</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">===</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&gt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// This is the target row, only unelect cells before the target cell</span>
                                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">===</span> <span class="nx">nTargetTrIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// Unselect all cells on this row</span>
                                <span class="k">else</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is below target row</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="c1">// Unselect all cells from target cell to anchor cell</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">currentRow</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="c1">// This is the target row, only unselect cells after the target cell</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">nTargetTrIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&gt;</span><span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// This is the anchor row, only unselect cells before the anchor cell</span>
                                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// Unselect all cells on this row</span>
                                <span class="k">else</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>

                    <span class="c1">// Select the target cell</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Invalid anchor</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Set anchor</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTargetCell</span><span class="p">;</span>

                <span class="c1">// Toggle selection of target</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>

        <span class="p">}</span>
         <span class="c1">// Only SHIFT</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">bSHIFT</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllCells</span><span class="p">();</span>

            <span class="c1">// Validate anchor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// All cells are on the same row</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">===</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select all cells between anchor cell and target cell,</span>
                    <span class="c1">// including the anchor cell and target cell</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Select all cells between target cell and anchor cell</span>
                    <span class="c1">// including the target cell and anchor cell</span>
                    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nTargetColKeyIndex</span> <span class="o">&lt;</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Anchor row is above target row</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select the cellblock from anchor cell to target cell</span>
                    <span class="c1">// including the anchor cell and the target cell</span>
                    <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>
                    <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>

                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Anchor row is below target row</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// Select the cellblock from target cell to anchor cell</span>
                    <span class="c1">// including the target cell and the anchor cell</span>
                    <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>
                    <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">nTargetColKeyIndex</span><span class="p">);</span>

                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Invalid anchor</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Set anchor</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTargetCell</span><span class="p">;</span>

                <span class="c1">// Select target only</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Only CTRL</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">bCTRL</span><span class="p">)</span> <span class="p">{</span>

            <span class="c1">// Set anchor</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTargetCell</span><span class="p">;</span>

            <span class="c1">// Toggle selection of target</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
            <span class="p">}</span>

        <span class="p">}</span>
        <span class="c1">// Neither SHIFT nor CTRL</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleCellSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a key event when selection mode</span>
<span class="cm"> * is set to &quot;cellblock&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleCellBlockSelectionByKey</span>
<span class="cm"> * @param e {HTMLEvent} Event object.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleCellBlockSelectionByKey</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nKey</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">bSHIFT</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">;</span>
    <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">9</span><span class="p">)</span> <span class="o">||</span> <span class="o">!</span><span class="nx">bSHIFT</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleCellSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">&gt;</span> <span class="mi">36</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nKey</span> <span class="o">&lt;</span> <span class="mi">41</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Validate trigger</span>
        <span class="kd">var</span> <span class="nx">oTrigger</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionTrigger</span><span class="p">();</span>
        <span class="c1">// Arrow selection only works if last selected row is on current page</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="nx">Ev</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>

        <span class="c1">// Validate anchor</span>
        <span class="kd">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionAnchor</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">);</span>

        <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">startIndex</span><span class="p">,</span> <span class="nx">endIndex</span><span class="p">,</span> <span class="nx">elNew</span><span class="p">,</span> <span class="nx">elNewRow</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">elThisRow</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>

        <span class="c1">// Determine which direction we&#39;re going to</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">40</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// arrow down</span>
            <span class="c1">// Selecting away from anchor cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select the horiz block on the next row...</span>
                <span class="c1">// ...making sure there is room below the trigger row</span>
                <span class="nx">elNewRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getNextTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">startIndex</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span>
                    <span class="nx">endIndex</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span>
                    <span class="c1">// ...going left</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">startIndex</span> <span class="o">&gt;</span> <span class="nx">endIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// ... going right</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Unselecting towards anchor cell</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">);</span>
                <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">);</span>
                <span class="c1">// Unselect the horiz block on this row towards the next row</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Arrow up</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">38</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Selecting away from anchor cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&gt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select the horiz block on the previous row...</span>
                <span class="c1">// ...making sure there is room</span>
                <span class="nx">elNewRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select in order from anchor to trigger...</span>
                    <span class="nx">startIndex</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span>
                    <span class="nx">endIndex</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span>
                    <span class="c1">// ...going left</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">startIndex</span> <span class="o">&gt;</span> <span class="nx">endIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// ... going right</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Unselecting towards anchor cell</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">);</span>
                <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">);</span>
                <span class="c1">// Unselect the horiz block on this row towards the previous row</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Arrow right</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">39</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Selecting away from anchor cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select the next vert block to the right...</span>
                <span class="c1">// ...making sure there is room</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select in order from anchor to trigger...</span>
                    <span class="nx">startIndex</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span>
                    <span class="nx">endIndex</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span>
                    <span class="c1">// ...going up</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">startIndex</span> <span class="o">&gt;</span> <span class="nx">endIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// ... going down</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Unselecting towards anchor cell</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Unselect the vert block on this column towards the right</span>
                <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">);</span>
                <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">);</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">]);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Arrow left</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">37</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Selecting away from anchor cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&gt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//Select the previous vert block to the left</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select in order from anchor to trigger...</span>
                    <span class="nx">startIndex</span> <span class="o">=</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span>
                    <span class="nx">endIndex</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span>
                    <span class="c1">// ...going up</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">startIndex</span> <span class="o">&gt;</span> <span class="nx">endIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// ... going down</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Unselecting towards anchor cell</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Unselect the vert block on this column towards the left</span>
                <span class="nx">startIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">min</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">);</span>
                <span class="nx">endIndex</span> <span class="o">=</span> <span class="nb">Math</span><span class="p">.</span><span class="nx">max</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">,</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">);</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">startIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">endIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">]);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a mouse event when selection mode</span>
<span class="cm"> * is set to &quot;cellrange&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleCellRangeSelectionByMouse</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleCellRangeSelectionByMouse</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">;</span>

    <span class="c1">// Validate target cell</span>
    <span class="kd">var</span> <span class="nx">elTargetCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">e</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">event</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">bSHIFT</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">bCTRL</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">ctrlKey</span> <span class="o">||</span> <span class="p">((</span><span class="nx">navigator</span><span class="p">.</span><span class="nx">userAgent</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">().</span><span class="nx">indexOf</span><span class="p">(</span><span class="s2">&quot;mac&quot;</span><span class="p">)</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nx">e</span><span class="p">.</span><span class="nx">metaKey</span><span class="p">);</span>

        <span class="kd">var</span> <span class="nx">elTargetRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">nTargetTrIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrIndex</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oTargetColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">nTargetColKeyIndex</span> <span class="o">=</span> <span class="nx">oTargetColumn</span><span class="p">.</span><span class="nx">getKeyIndex</span><span class="p">();</span>
        <span class="kd">var</span> <span class="nx">oTargetRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">nTargetRecordIndex</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecordIndex</span><span class="p">(</span><span class="nx">oTargetRecord</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oTargetCell</span> <span class="o">=</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oTargetRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oTargetColumn</span><span class="p">};</span>

        <span class="kd">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionAnchor</span><span class="p">();</span>

        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">currentRow</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">j</span><span class="p">;</span>

        <span class="c1">// Both SHIFT and CTRL</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">bSHIFT</span> <span class="o">&amp;&amp;</span> <span class="nx">bCTRL</span><span class="p">)</span> <span class="p">{</span>

            <span class="c1">// Validate anchor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Anchor is selected</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">cell</span><span class="p">))</span> <span class="p">{</span>
                    <span class="c1">// All cells are on the same row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">===</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Select all cells between anchor cell and target cell, including target cell</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="c1">// Select all cells between target cell and anchor cell, including target cell</span>
                        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nTargetColKeyIndex</span> <span class="o">&lt;</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is above target row</span>
                    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Select all cells on anchor row from anchor cell to the end of the row</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>

                        <span class="c1">// Select all cells on all rows between anchor row and target row</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">){</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>

                        <span class="c1">// Select all cells on target row from first cell to the target cell</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is below target row</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="c1">// Select all cells on target row from target cell to the end of the row</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>

                        <span class="c1">// Select all cells on all rows between target row and anchor row</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetTrIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">){</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>

                        <span class="c1">// Select all cells on anchor row from first cell to the anchor cell</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Anchor cell is unselected</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// All cells are on the same row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">===</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Unselect all cells between anchor cell and target cell</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="c1">// Select all cells between target cell and anchor cell</span>
                        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nTargetColKeyIndex</span> <span class="o">&lt;</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetColKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is above target row</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Unselect all cells from anchor cell to target cell</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">currentRow</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="c1">// This is the anchor row, only unselect cells after the anchor cell</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">===</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&gt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// This is the target row, only unelect cells before the target cell</span>
                                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">===</span> <span class="nx">nTargetTrIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// Unselect all cells on this row</span>
                                <span class="k">else</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Anchor row is below target row</span>
                    <span class="k">else</span> <span class="p">{</span>
                        <span class="c1">// Unselect all cells from target cell to anchor cell</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">currentRow</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                            <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                                <span class="c1">// This is the target row, only unselect cells after the target cell</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">nTargetTrIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&gt;</span><span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// This is the anchor row, only unselect cells before the anchor cell</span>
                                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                                <span class="c1">// Unselect all cells on this row</span>
                                <span class="k">else</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>

                    <span class="c1">// Select the target cell</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Invalid anchor</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Set anchor</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTargetCell</span><span class="p">;</span>

                <span class="c1">// Toggle selection of target</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">))</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
         <span class="c1">// Only SHIFT</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">bSHIFT</span><span class="p">)</span> <span class="p">{</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllCells</span><span class="p">();</span>

            <span class="c1">// Validate anchor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// All cells are on the same row</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">===</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select all cells between anchor cell and target cell,</span>
                    <span class="c1">// including the anchor cell and target cell</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                    <span class="c1">// Select all cells between target cell and anchor cell</span>
                    <span class="c1">// including the target cell and anchor cell</span>
                    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nTargetColKeyIndex</span> <span class="o">&lt;</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetColKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Anchor row is above target row</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">nTargetRecordIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select all cells from anchor cell to target cell</span>
                    <span class="c1">// including the anchor cell and target cell</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">currentRow</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="c1">// This is the anchor row, only select the anchor cell and after</span>
                            <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&gt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                            <span class="c1">// This is the target row, only select the target cell and before</span>
                            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">nTargetTrIndex</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&lt;=</span><span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                            <span class="c1">// Select all cells on this row</span>
                            <span class="k">else</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Anchor row is below target row</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// Select all cells from target cell to anchor cell,</span>
                    <span class="c1">// including the target cell and anchor cell</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">nTargetTrIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">currentRow</span> <span class="o">=</span> <span class="nx">allRows</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                        <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
                            <span class="c1">// This is the target row, only select the target cell and after</span>
                            <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">nTargetTrIndex</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&gt;=</span><span class="nx">nTargetColKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                            <span class="c1">// This is the anchor row, only select the anchor cell and before</span>
                            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">sectionRowIndex</span> <span class="o">==</span> <span class="nx">oAnchor</span><span class="p">.</span><span class="nx">trIndex</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">if</span><span class="p">(</span><span class="nx">j</span><span class="o">&lt;=</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                            <span class="c1">// Select all cells on this row</span>
                            <span class="k">else</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">currentRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Invalid anchor</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Set anchor</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTargetCell</span><span class="p">;</span>

                <span class="c1">// Select target only</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
            <span class="p">}</span>


        <span class="p">}</span>
        <span class="c1">// Only CTRL</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">bCTRL</span><span class="p">)</span> <span class="p">{</span>

            <span class="c1">// Set anchor</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTargetCell</span><span class="p">;</span>

            <span class="c1">// Toggle selection of target</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">isSelected</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
            <span class="p">}</span>

        <span class="p">}</span>
        <span class="c1">// Neither SHIFT nor CTRL</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleCellSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a key event when selection mode</span>
<span class="cm"> * is set to &quot;cellrange&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleCellRangeSelectionByKey</span>
<span class="cm"> * @param e {HTMLEvent} Event object.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleCellRangeSelectionByKey</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nKey</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">bSHIFT</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">;</span>
    <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">9</span><span class="p">)</span> <span class="o">||</span> <span class="o">!</span><span class="nx">bSHIFT</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleCellSelectionByKey</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">&gt;</span> <span class="mi">36</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nKey</span> <span class="o">&lt;</span> <span class="mi">41</span><span class="p">))</span> <span class="p">{</span>
        <span class="c1">// Validate trigger</span>
        <span class="kd">var</span> <span class="nx">oTrigger</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionTrigger</span><span class="p">();</span>
        <span class="c1">// Arrow selection only works if last selected row is on current page</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="nx">Ev</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>

        <span class="c1">// Validate anchor</span>
        <span class="kd">var</span> <span class="nx">oAnchor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionAnchor</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">);</span>

        <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">elNewRow</span><span class="p">,</span> <span class="nx">elNew</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">allRows</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">().</span><span class="nx">rows</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">elThisRow</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">;</span>

        <span class="c1">// Arrow down</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">40</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elNewRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getNextTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Selecting away from anchor cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select all cells to the end of this row</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">){</span>
                    <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                <span class="p">}</span>

                <span class="c1">// Select some of the cells on the next row down</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;=</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">){</span>
                        <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Unselecting towards anchor cell</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Unselect all cells to the end of this row</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">){</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="p">}</span>

                <span class="c1">// Unselect some of the cells on the next row down</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">){</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Arrow up</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">38</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elNewRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Selecting away from anchor cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&gt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select all the cells to the beginning of this row</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">){</span>
                    <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                <span class="p">}</span>

                <span class="c1">// Select some of the cells from the end of the previous row</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;=</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">){</span>
                        <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Unselecting towards anchor cell</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Unselect all the cells to the beginning of this row</span>
                <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">){</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="p">}</span>

                <span class="c1">// Unselect some of the cells from the end of the previous row</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">){</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Arrow right</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">39</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elNewRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getNextTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Selecting away from anchor cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select the next cell to the right</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="c1">// Select the first cell of the next row</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">elNewRow</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Unselecting towards anchor cell</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&gt;</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">]);</span>

                <span class="c1">// Unselect this cell towards the right</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                <span class="p">}</span>
                <span class="c1">// Unselect this cells towards the first cell of the next row</span>
                <span class="k">else</span> <span class="p">{</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Anchor is on this row</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Selecting away from anchor</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select the next cell to the right</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&lt;</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">+</span><span class="mi">1</span><span class="p">];</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="c1">// Select the first cell on the next row</span>
                    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span> <span class="o">&lt;</span> <span class="nx">allRows</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">){</span>
                        <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="mi">0</span><span class="p">];</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Unselecting towards anchor</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// Unselect this cell towards the right</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">]);</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="c1">// Arrow left</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">37</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">elNewRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTrEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Unselecting towards the anchor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&lt;</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">]);</span>

                <span class="c1">// Unselect this cell towards the left</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="p">}</span>
                <span class="c1">// Unselect this cell towards the last cell of the previous row</span>
                <span class="k">else</span> <span class="p">{</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Selecting towards the anchor</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">recordIndex</span> <span class="o">&gt;</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">recordIndex</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Select the next cell to the left</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                <span class="p">}</span>
                <span class="c1">// Select the last cell of the previous row</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">){</span>
                    <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Anchor is on this row</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="c1">// Selecting away from anchor cell</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">oAnchor</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&gt;=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// Select the next cell to the left</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="c1">// Select the last cell of the previous row</span>
                    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">trIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">){</span>
                        <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">elNewRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">];</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// Unselecting towards anchor cell</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">unselectCell</span><span class="p">(</span><span class="nx">elThisRow</span><span class="p">.</span><span class="nx">cells</span><span class="p">[</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span><span class="p">]);</span>

                    <span class="c1">// Unselect this cell towards the left</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">colKeyIndex</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                    <span class="p">}</span>
                    <span class="c1">// Unselect this cell towards the last cell of the previous row</span>
                    <span class="k">else</span> <span class="p">{</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a mouse event when selection mode</span>
<span class="cm"> * is set to &quot;singlecell&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleSingleCellSelectionByMouse</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleSingleCellSelectionByMouse</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elTarget</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">;</span>

    <span class="c1">// Validate target cell</span>
    <span class="kd">var</span> <span class="nx">elTargetCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">elTarget</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">elTargetRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oTargetRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elTargetRow</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oTargetColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">elTargetCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oTargetCell</span> <span class="o">=</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oTargetRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oTargetColumn</span><span class="p">};</span>

        <span class="c1">// Set anchor</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="nx">oTargetCell</span><span class="p">;</span>

        <span class="c1">// Select only target</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllCells</span><span class="p">();</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">oTargetCell</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Determines selection behavior resulting from a key event when selection mode</span>
<span class="cm"> * is set to &quot;singlecell&quot;.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _handleSingleCellSelectionByKey</span>
<span class="cm"> * @param e {HTMLEvent} Event object.</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleSingleCellSelectionByKey</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">nKey</span> <span class="o">=</span> <span class="nx">Ev</span><span class="p">.</span><span class="nx">getCharCode</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
    <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">9</span><span class="p">)</span> <span class="o">||</span> <span class="p">((</span><span class="nx">nKey</span> <span class="o">&gt;</span> <span class="mi">36</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nKey</span> <span class="o">&lt;</span> <span class="mi">41</span><span class="p">)))</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">bSHIFT</span> <span class="o">=</span> <span class="nx">e</span><span class="p">.</span><span class="nx">shiftKey</span><span class="p">;</span>

        <span class="c1">// Validate trigger</span>
        <span class="kd">var</span> <span class="nx">oTrigger</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_getSelectionTrigger</span><span class="p">();</span>
        <span class="c1">// Arrow selection only works if last selected row is on current page</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oTrigger</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="c1">// Determine the new cell to select</span>
        <span class="kd">var</span> <span class="nx">elNew</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">40</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// Arrow down</span>
            <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getBelowTdEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Validate new cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNew</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//TODO: wrap around to first tr on current page</span>

                <span class="c1">//TODO: wrap forward to first tr of next page</span>

                <span class="c1">// Bottom selection is sticky</span>
                <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">38</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// Arrow up</span>
            <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getAboveTdEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Validate new cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNew</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//TODO: wrap around to last tr on current page</span>

                <span class="c1">//TODO: wrap back to last tr of previous page</span>

                <span class="c1">// Top selection is sticky</span>
                <span class="nx">elNew</span> <span class="o">=</span> <span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">39</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="o">!</span><span class="nx">bSHIFT</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">9</span><span class="p">)))</span> <span class="p">{</span> <span class="c1">// Arrow right or tab</span>
            <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getNextTdEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Validate new cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNew</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//TODO: wrap around to first td on current page</span>

                <span class="c1">//TODO: wrap forward to first td of next page</span>

                <span class="c1">// Top-left selection is sticky, and release TAB focus</span>
                <span class="c1">//elNew = oTrigger.el;</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">((</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">37</span><span class="p">)</span> <span class="o">||</span> <span class="p">(</span><span class="nx">bSHIFT</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">nKey</span> <span class="o">==</span> <span class="mi">9</span><span class="p">)))</span> <span class="p">{</span> <span class="c1">// Arrow left or shift-tab</span>
            <span class="nx">elNew</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getPreviousTdEl</span><span class="p">(</span><span class="nx">oTrigger</span><span class="p">.</span><span class="nx">el</span><span class="p">);</span>

            <span class="c1">// Validate new cell</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">elNew</span> <span class="o">===</span> <span class="kc">null</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//TODO: wrap around to last td on current page</span>

                <span class="c1">//TODO: wrap back to last td of previous page</span>

                <span class="c1">// Bottom-right selection is sticky, and release TAB focus</span>
                <span class="c1">//elNew = oTrigger.el;</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="nx">Ev</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">e</span><span class="p">);</span>
        
        <span class="c1">// Unselect all cells</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">unselectAllCells</span><span class="p">();</span>

        <span class="c1">// Select the new cell</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">selectCell</span><span class="p">(</span><span class="nx">elNew</span><span class="p">);</span>

        <span class="c1">// Set new anchor</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elNew</span><span class="p">),</span> <span class="nx">column</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">elNew</span><span class="p">)};</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns array of selected TR elements on the page.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getSelectedTrEls</span>
<span class="cm"> * @return {HTMLElement[]} Array of selected TR elements.</span>
<span class="cm"> */</span>
<span class="nx">getSelectedTrEls</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">,</span><span class="s2">&quot;tr&quot;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sets given row to the selected state.</span>
<span class="cm"> *</span>
<span class="cm"> * @method selectRow</span>
<span class="cm"> * @param row {HTMLElement | String | YAHOO.widget.Record | Number} HTML element</span>
<span class="cm"> * reference or ID string, Record instance, or RecordSet position index.</span>
<span class="cm"> */</span>
<span class="nx">selectRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">elRow</span><span class="p">;</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">row</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
        <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
        <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elRow</span><span class="p">);</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Update selection trackers</span>
        <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
        <span class="kd">var</span> <span class="nx">sRecordId</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>
        <span class="kd">var</span> <span class="nx">index</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>

        <span class="c1">// Remove if already there:</span>
        <span class="c1">// Use Array.indexOf if available...</span>
        <span class="cm">/*if(tracker.indexOf &amp;&amp; (tracker.indexOf(sRecordId) &gt;  -1)) {</span>
<span class="cm">            tracker.splice(tracker.indexOf(sRecordId),1);</span>
<span class="cm">        }*/</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">index</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">sRecordId</span><span class="p">);</span>
            
        <span class="p">}</span>
        <span class="c1">// ...or do it the old-fashioned way</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">){</span>
                    <span class="nx">index</span> <span class="o">=</span> <span class="nx">j</span><span class="p">;</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">index</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">index</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
        <span class="p">}</span>
        
        <span class="c1">// Add to the end</span>
        <span class="nx">tracker</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">sRecordId</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">;</span>

        <span class="c1">// Update trackers</span>
        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorRecord</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">;</span>
        <span class="p">}</span>

        <span class="c1">// Update UI</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elRow</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowSelectEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elRow</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Selected &quot;</span> <span class="o">+</span> <span class="nx">elRow</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not select row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sets given row to the unselected state.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unselectRow</span>
<span class="cm"> * @param row {HTMLElement | String | YAHOO.widget.Record | Number} HTML element</span>
<span class="cm"> * reference or ID string, Record instance, or RecordSet position index.</span>
<span class="cm"> */</span>
<span class="nx">unselectRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>

    <span class="kd">var</span> <span class="nx">oRecord</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">row</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">row</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elRow</span><span class="p">);</span>
    <span class="p">}</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Update selection trackers</span>
        <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
        <span class="kd">var</span> <span class="nx">sRecordId</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>
        <span class="kd">var</span> <span class="nx">index</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>

        <span class="c1">// Use Array.indexOf if available...</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">index</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">sRecordId</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// ...or do it the old-fashioned way</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">){</span>
                    <span class="nx">index</span> <span class="o">=</span> <span class="nx">j</span><span class="p">;</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">index</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Update tracker</span>
            <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">index</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">;</span>

            <span class="c1">// Update the UI</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elRow</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowUnselectEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elRow</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Unselected &quot;</span> <span class="o">+</span> <span class="nx">elRow</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>

            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not unselect row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Clears out all row selections.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unselectAllRows</span>
<span class="cm"> */</span>
<span class="nx">unselectAllRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Remove all rows from tracker</span>
    <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[],</span>
        <span class="nx">recId</span><span class="p">,</span>
        <span class="nx">removed</span> <span class="o">=</span> <span class="p">[];</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
       <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])){</span>
            <span class="nx">recId</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">j</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
            <span class="nx">removed</span><span class="p">[</span><span class="nx">removed</span><span class="p">.</span><span class="nx">length</span><span class="p">]</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">recId</span><span class="p">)</span> <span class="o">?</span> <span class="nx">recId</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">:</span> <span class="nx">recId</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="c1">// Update tracker</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">;</span>

    <span class="c1">// Update UI</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_unselectAllTrEls</span><span class="p">();</span>

    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;unselectAllRowsEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">records</span><span class="o">:</span> <span class="nx">removed</span><span class="p">});</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Unselected all rows&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED</span>
<span class="cm"> * from all TD elements in the internal tracker.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _unselectAllTdEls</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_unselectAllTdEls</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">selectedCells</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">,</span><span class="s2">&quot;td&quot;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">);</span>
    <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">selectedCells</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns array of selected TD elements on the page.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getSelectedTdEls</span>
<span class="cm"> * @return {HTMLElement[]} Array of selected TD elements.</span>
<span class="cm"> */</span>
<span class="nx">getSelectedTdEls</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getElementsByClassName</span><span class="p">(</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">,</span><span class="s2">&quot;td&quot;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sets given cell to the selected state.</span>
<span class="cm"> *</span>
<span class="cm"> * @method selectCell</span>
<span class="cm"> * @param cell {HTMLElement | String | Object} TD element or child of a TD element, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn}.</span>
<span class="cm"> */</span>
<span class="nx">selectCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">//TODO: accept {record} in selectCell()</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">));</span>
        <span class="kd">var</span> <span class="nx">sColumnKey</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKey</span><span class="p">();</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span> <span class="o">&amp;&amp;</span> <span class="nx">sColumnKey</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Get Record ID</span>
            <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
            <span class="kd">var</span> <span class="nx">sRecordId</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>

            <span class="c1">// Remove if there</span>
            <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
               <span class="k">if</span><span class="p">((</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">columnKey</span> <span class="o">===</span> <span class="nx">sColumnKey</span><span class="p">)){</span>
                    <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">j</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="c1">// Add to the end</span>
            <span class="nx">tracker</span><span class="p">.</span><span class="nx">push</span><span class="p">({</span><span class="nx">recordId</span><span class="o">:</span><span class="nx">sRecordId</span><span class="p">,</span> <span class="nx">columnKey</span><span class="o">:</span><span class="nx">sColumnKey</span><span class="p">});</span>

            <span class="c1">// Update trackers</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">;</span>
            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_oAnchorCell</span> <span class="o">=</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">};</span>
            <span class="p">}</span>

            <span class="c1">// Update the UI</span>
            <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elCell</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellSelectEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">key</span><span class="o">:</span> <span class="nx">sColumnKey</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elCell</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Selected &quot;</span> <span class="o">+</span> <span class="nx">elCell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
            <span class="k">return</span><span class="p">;</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not select cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Sets given cell to the unselected state.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unselectCell</span>
<span class="cm"> * @param cell {HTMLElement | String | Object} TD element or child of a TD element, or</span>
<span class="cm"> * object literal of syntax {record:oRecord, column:oColumn}.</span>
<span class="cm"> * @param cell {HTMLElement | String} DOM element reference or ID string</span>
<span class="cm"> * to DataTable page element or RecordSet index.</span>
<span class="cm"> */</span>
<span class="nx">unselectCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">));</span>
        <span class="kd">var</span> <span class="nx">sColumnKey</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKey</span><span class="p">();</span>

        <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span> <span class="o">&amp;&amp;</span> <span class="nx">sColumnKey</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Get Record ID</span>
            <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
            <span class="kd">var</span> <span class="nx">id</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>

            <span class="c1">// Is it selected?</span>
            <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">((</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">===</span> <span class="nx">id</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">columnKey</span> <span class="o">===</span> <span class="nx">sColumnKey</span><span class="p">)){</span>
                    <span class="c1">// Remove from tracker</span>
                    <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">j</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>

                    <span class="c1">// Update tracker</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">;</span>

                    <span class="c1">// Update the UI</span>
                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elCell</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">);</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellUnselectEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span> <span class="nx">oColumn</span><span class="p">,</span> <span class="nx">key</span><span class="o">:</span><span class="nx">sColumnKey</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elCell</span><span class="p">});</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Unselected &quot;</span> <span class="o">+</span> <span class="nx">elCell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not unselect cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Clears out all cell selections.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unselectAllCells</span>
<span class="cm"> */</span>
<span class="nx">unselectAllCells</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Remove all cells from tracker</span>
    <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
       <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])){</span>
            <span class="nx">tracker</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">j</span><span class="p">,</span><span class="mi">1</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="c1">// Update tracker</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">=</span> <span class="nx">tracker</span><span class="p">;</span>

    <span class="c1">// Update UI</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_unselectAllTdEls</span><span class="p">();</span>

    <span class="c1">//TODO: send data to unselectAllCellsEvent handler</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;unselectAllCellsEvent&quot;</span><span class="p">);</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Unselected all cells&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns true if given item is selected, false otherwise.</span>
<span class="cm"> *</span>
<span class="cm"> * @method isSelected</span>
<span class="cm"> * @param o {String | HTMLElement | YAHOO.widget.Record | Number</span>
<span class="cm"> * {record:YAHOO.widget.Record, column:YAHOO.widget.Column} } TR or TD element by</span>
<span class="cm"> * reference or ID string, a Record instance, a RecordSet position index,</span>
<span class="cm"> * or an object literal representation</span>
<span class="cm"> * of a cell.</span>
<span class="cm"> * @return {Boolean} True if item is selected.</span>
<span class="cm"> */</span>
<span class="nx">isSelected</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">o</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">ownerDocument</span> <span class="o">==</span> <span class="nb">document</span><span class="p">))</span> <span class="p">{</span>
        <span class="k">return</span> <span class="p">(</span><span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">o</span><span class="p">),</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">)</span> <span class="o">||</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">hasClass</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">o</span><span class="p">),</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_SELECTED</span><span class="p">));</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">sRecordId</span><span class="p">,</span> <span class="nx">j</span><span class="p">;</span>
        <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span><span class="p">;</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span> <span class="o">&amp;&amp;</span> <span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Looking for a Record?</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">o</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">oRecord</span> <span class="o">=</span> <span class="nx">o</span><span class="p">;</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">o</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">o</span><span class="p">);</span>
            <span class="p">}</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">sRecordId</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>

                <span class="c1">// Is it there?</span>
                <span class="c1">// Use Array.indexOf if available...</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">sRecordId</span><span class="p">)</span> <span class="o">&gt;</span>  <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
                <span class="c1">// ...or do it the old-fashioned way</span>
                <span class="k">else</span> <span class="p">{</span>
                    <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                       <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">){</span>
                        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                       <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Looking for a cell</span>
            <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">record</span> <span class="o">&amp;&amp;</span> <span class="nx">o</span><span class="p">.</span><span class="nx">column</span><span class="p">){</span>
                <span class="nx">sRecordId</span> <span class="o">=</span> <span class="nx">o</span><span class="p">.</span><span class="nx">record</span><span class="p">.</span><span class="nx">getId</span><span class="p">();</span>
                <span class="kd">var</span> <span class="nx">sColumnKey</span> <span class="o">=</span> <span class="nx">o</span><span class="p">.</span><span class="nx">column</span><span class="p">.</span><span class="nx">getKey</span><span class="p">();</span>

                <span class="k">for</span><span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">j</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">((</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">===</span> <span class="nx">sRecordId</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">columnKey</span> <span class="o">===</span> <span class="nx">sColumnKey</span><span class="p">)){</span>
                        <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns selected rows as an array of Record IDs.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getSelectedRows</span>
<span class="cm"> * @return {String[]} Array of selected rows by Record ID.</span>
<span class="cm"> */</span>
<span class="nx">getSelectedRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">aSelectedRows</span> <span class="o">=</span> <span class="p">[];</span>
    <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
       <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])){</span>
            <span class="nx">aSelectedRows</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nx">aSelectedRows</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns selected cells as an array of object literals:</span>
<span class="cm"> *     {recordId:sRecordId, columnKey:sColumnKey}.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getSelectedCells</span>
<span class="cm"> * @return {Object[]} Array of selected cells by Record ID and Column ID.</span>
<span class="cm"> */</span>
<span class="nx">getSelectedCells</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">aSelectedCells</span> <span class="o">=</span> <span class="p">[];</span>
    <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span> <span class="o">||</span> <span class="p">[];</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
       <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">])){</span>
            <span class="nx">aSelectedCells</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">j</span><span class="p">]);</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="nx">aSelectedCells</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns last selected Record ID.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getLastSelectedRecord</span>
<span class="cm"> * @return {String} Record ID of last selected row.</span>
<span class="cm"> */</span>
<span class="nx">getLastSelectedRecord</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span> <span class="o">&amp;&amp;</span> <span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
           <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">])){</span>
                <span class="k">return</span> <span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns last selected cell as an object literal:</span>
<span class="cm"> *     {recordId:sRecordId, columnKey:sColumnKey}.</span>
<span class="cm"> *</span>
<span class="cm"> * @method getLastSelectedCell</span>
<span class="cm"> * @return {Object} Object literal representation of a cell.</span>
<span class="cm"> */</span>
<span class="nx">getLastSelectedCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">tracker</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_aSelections</span><span class="p">;</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span> <span class="o">&amp;&amp;</span> <span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="nx">tracker</span><span class="p">.</span><span class="nx">length</span><span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">&gt;-</span><span class="mi">1</span><span class="p">;</span> <span class="nx">i</span><span class="o">--</span><span class="p">)</span> <span class="p">{</span>
           <span class="k">if</span><span class="p">(</span><span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">recordId</span> <span class="o">&amp;&amp;</span> <span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">].</span><span class="nx">columnKey</span><span class="p">){</span>
                <span class="k">return</span> <span class="nx">tracker</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given row.</span>
<span class="cm"> *</span>
<span class="cm"> * @method highlightRow</span>
<span class="cm"> * @param row {HTMLElement | String} DOM element reference or ID string.</span>
<span class="cm"> */</span>
<span class="nx">highlightRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Make sure previous row is unhighlighted</span>
<span class="cm">/*        if(this._sLastHighlightedTrElId) {</span>
<span class="cm">            Dom.removeClass(this._sLastHighlightedTrElId,DT.CLASS_HIGHLIGHTED);</span>
<span class="cm">        }*/</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elRow</span><span class="p">);</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elRow</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>
        <span class="c1">//this._sLastHighlightedTrElId = elRow.id;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowHighlightEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elRow</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Highlighted &quot;</span> <span class="o">+</span> <span class="nx">elRow</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not highlight row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given row.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unhighlightRow</span>
<span class="cm"> * @param row {HTMLElement | String} DOM element reference or ID string.</span>
<span class="cm"> */</span>
<span class="nx">unhighlightRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">row</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elRow</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">row</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">elRow</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elRow</span><span class="p">);</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elRow</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;rowUnhighlightEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elRow</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Unhighlighted &quot;</span> <span class="o">+</span> <span class="nx">elRow</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not unhighlight row &quot;</span> <span class="o">+</span> <span class="nx">row</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED to the given cell.</span>
<span class="cm"> *</span>
<span class="cm"> * @method highlightCell</span>
<span class="cm"> * @param cell {HTMLElement | String} DOM element reference or ID string.</span>
<span class="cm"> */</span>
<span class="nx">highlightCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Make sure previous cell is unhighlighted</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elLastHighlightedTd</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">unhighlightCell</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elLastHighlightedTd</span><span class="p">);</span>
        <span class="p">}</span>

        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">));</span>
        <span class="kd">var</span> <span class="nx">sColumnKey</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">getKey</span><span class="p">();</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elCell</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elLastHighlightedTd</span> <span class="o">=</span> <span class="nx">elCell</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellHighlightEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">key</span><span class="o">:</span><span class="nx">sColumnKey</span><span class="p">,</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elCell</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Highlighted &quot;</span> <span class="o">+</span> <span class="nx">elCell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not highlight cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Removes the class YAHOO.widget.DataTable.CLASS_HIGHLIGHTED from the given cell.</span>
<span class="cm"> *</span>
<span class="cm"> * @method unhighlightCell</span>
<span class="cm"> * @param cell {HTMLElement | String} DOM element reference or ID string.</span>
<span class="cm"> */</span>
<span class="nx">unhighlightCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">cell</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">cell</span><span class="p">);</span>

    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="nx">Dom</span><span class="p">.</span><span class="nx">removeClass</span><span class="p">(</span><span class="nx">elCell</span><span class="p">,</span><span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_HIGHLIGHTED</span><span class="p">);</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_elLastHighlightedTd</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;cellUnhighlightEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">record</span><span class="o">:</span><span class="nx">oRecord</span><span class="p">,</span> <span class="nx">column</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)),</span> <span class="nx">key</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)).</span><span class="nx">getKey</span><span class="p">(),</span> <span class="nx">el</span><span class="o">:</span><span class="nx">elCell</span><span class="p">});</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Unhighlighted &quot;</span> <span class="o">+</span> <span class="nx">elCell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not unhighlight cell &quot;</span> <span class="o">+</span> <span class="nx">cell</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>













































<span class="c1">// INLINE EDITING</span>

<span class="cm">/**</span>
<span class="cm"> * Assigns CellEditor instance to existing Column.</span>
<span class="cm"> * @method addCellEditor</span>
<span class="cm"> * @param oColumn {YAHOO.widget.Column} Column instance.</span>
<span class="cm"> * @param oEditor {YAHOO.wdiget.CellEditor} CellEditor instance.</span>
<span class="cm"> */</span>
<span class="nx">addCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">,</span> <span class="nx">oEditor</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span> <span class="o">=</span> <span class="nx">oEditor</span><span class="p">;</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;showEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorShowEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;keydownEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorKeydownEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;revertEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorRevertEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;saveEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorSaveEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;cancelEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorCancelEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;blurEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorBlurEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;blockEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorBlockEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">subscribe</span><span class="p">(</span><span class="s2">&quot;unblockEvent&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onEditorUnblockEvent</span><span class="p">,</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Returns current CellEditor instance, or null.</span>
<span class="cm"> * @method getCellEditor</span>
<span class="cm"> * @return {YAHOO.widget.CellEditor} CellEditor instance.</span>
<span class="cm"> */</span>
<span class="nx">getCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">;</span>
<span class="p">},</span>


<span class="cm">/**</span>
<span class="cm"> * Activates and shows CellEditor instance for the given cell while deactivating and</span>
<span class="cm"> * canceling previous CellEditor. It is baked into DataTable that only one CellEditor</span>
<span class="cm"> * can be active at any given time. </span>
<span class="cm"> *</span>
<span class="cm"> * @method showCellEditor</span>
<span class="cm"> * @param elCell {HTMLElement | String} Cell to edit.</span>
<span class="cm"> */</span>
<span class="nx">showCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elCell</span><span class="p">,</span> <span class="nx">oRecord</span><span class="p">,</span> <span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Get a particular CellEditor</span>
    <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">oCellEditor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">;</span>
            <span class="c1">// Clean up active CellEditor</span>
            <span class="k">if</span><span class="p">(</span><span class="nx">oCellEditor</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">isActive</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">cancelCellEditor</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span>
            
            <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">BaseCellEditor</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Get CellEditor</span>
                <span class="nx">oCellEditor</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">;</span>
                <span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">attach</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">elCell</span><span class="p">);</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">ok</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
                    <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">move</span><span class="p">();</span>
                    <span class="nx">ok</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeShowCellEditor</span><span class="p">(</span><span class="nx">oCellEditor</span><span class="p">);</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">ok</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">show</span><span class="p">();</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span> <span class="o">=</span> <span class="nx">oCellEditor</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Backward compatibility</span>
            <span class="k">else</span> <span class="p">{</span>
                    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oRecord</span> <span class="o">||</span> <span class="o">!</span><span class="p">(</span><span class="nx">oRecord</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Record</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">oRecord</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oColumn</span> <span class="o">||</span> <span class="o">!</span><span class="p">(</span><span class="nx">oColumn</span> <span class="k">instanceof</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Column</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
                    <span class="p">}</span>
                    <span class="k">if</span><span class="p">(</span><span class="nx">oRecord</span> <span class="o">&amp;&amp;</span> <span class="nx">oColumn</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">container</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">_initCellEditorEl</span><span class="p">();</span>
                        <span class="p">}</span>
                        
                        <span class="c1">// Update Editor values</span>
                        <span class="nx">oCellEditor</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">;</span>
                        <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">cell</span> <span class="o">=</span> <span class="nx">elCell</span><span class="p">;</span>
                        <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">record</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">;</span>
                        <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">column</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">;</span>
                        <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">validator</span> <span class="o">=</span> <span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editorOptions</span> <span class="o">&amp;&amp;</span>
                                <span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editorOptions</span><span class="p">.</span><span class="nx">validator</span><span class="p">))</span> <span class="o">?</span>
                                <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editorOptions</span><span class="p">.</span><span class="nx">validator</span> <span class="o">:</span> <span class="kc">null</span><span class="p">;</span>
                        <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="nx">oRecord</span><span class="p">.</span><span class="nx">getData</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">key</span><span class="p">);</span>
                        <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">defaultValue</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
            
                        <span class="c1">// Move Editor</span>
                        <span class="kd">var</span> <span class="nx">elContainer</span> <span class="o">=</span> <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">container</span><span class="p">;</span>
                        <span class="kd">var</span> <span class="nx">x</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getX</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
                        <span class="kd">var</span> <span class="nx">y</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getY</span><span class="p">(</span><span class="nx">elCell</span><span class="p">);</span>
            
                        <span class="c1">// SF doesn&#39;t get xy for cells in scrolling table</span>
                        <span class="c1">// when tbody display is set to block</span>
                        <span class="k">if</span><span class="p">(</span><span class="nb">isNaN</span><span class="p">(</span><span class="nx">x</span><span class="p">)</span> <span class="o">||</span> <span class="nb">isNaN</span><span class="p">(</span><span class="nx">y</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">x</span> <span class="o">=</span> <span class="nx">elCell</span><span class="p">.</span><span class="nx">offsetLeft</span> <span class="o">+</span> <span class="c1">// cell pos relative to table</span>
                                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">getX</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="o">-</span> <span class="c1">// plus table pos relative to document</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">scrollLeft</span><span class="p">;</span> <span class="c1">// minus tbody scroll</span>
                            <span class="nx">y</span> <span class="o">=</span> <span class="nx">elCell</span><span class="p">.</span><span class="nx">offsetTop</span> <span class="o">+</span> <span class="c1">// cell pos relative to table</span>
                                    <span class="nx">Dom</span><span class="p">.</span><span class="nx">getY</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">parentNode</span><span class="p">)</span> <span class="o">-</span> <span class="c1">// plus table pos relative to document</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_elTbody</span><span class="p">.</span><span class="nx">scrollTop</span> <span class="o">+</span> <span class="c1">// minus tbody scroll</span>
                                    <span class="k">this</span><span class="p">.</span><span class="nx">_elThead</span><span class="p">.</span><span class="nx">offsetHeight</span><span class="p">;</span> <span class="c1">// account for fixed THEAD cells</span>
                        <span class="p">}</span>
            
                        <span class="nx">elContainer</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">left</span> <span class="o">=</span> <span class="nx">x</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">;</span>
                        <span class="nx">elContainer</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">top</span> <span class="o">=</span> <span class="nx">y</span> <span class="o">+</span> <span class="s2">&quot;px&quot;</span><span class="p">;</span>
            
                        <span class="c1">// Hook to customize the UI</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeShowCellEditor</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">);</span>
            
                        <span class="c1">//TODO: This is temporarily up here due so elements can be focused</span>
                        <span class="c1">// Show Editor</span>
                        <span class="nx">elContainer</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
            
                        <span class="c1">// Handle ESC key</span>
                        <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span> <span class="s2">&quot;keydown&quot;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">e</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
                            <span class="c1">// ESC hides Cell Editor</span>
                            <span class="k">if</span><span class="p">((</span><span class="nx">e</span><span class="p">.</span><span class="nx">keyCode</span> <span class="o">==</span> <span class="mi">27</span><span class="p">))</span> <span class="p">{</span>
                                <span class="nx">oSelf</span><span class="p">.</span><span class="nx">cancelCellEditor</span><span class="p">();</span>
                                <span class="nx">oSelf</span><span class="p">.</span><span class="nx">focusTbodyEl</span><span class="p">();</span>
                            <span class="p">}</span>
                            <span class="k">else</span> <span class="p">{</span>
                                <span class="nx">oSelf</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorKeydownEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="nx">oSelf</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">,</span> <span class="nx">event</span><span class="o">:</span><span class="nx">e</span><span class="p">});</span>
                            <span class="p">}</span>
                        <span class="p">},</span> <span class="k">this</span><span class="p">);</span>
            
                        <span class="c1">// Render Editor markup</span>
                        <span class="kd">var</span> <span class="nx">fnEditor</span><span class="p">;</span>
                        <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">))</span> <span class="p">{</span>
                            <span class="k">switch</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">case</span> <span class="s2">&quot;checkbox&quot;</span><span class="o">:</span>
                                    <span class="nx">fnEditor</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">editCheckbox</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                <span class="k">case</span> <span class="s2">&quot;date&quot;</span><span class="o">:</span>
                                    <span class="nx">fnEditor</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">editDate</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                <span class="k">case</span> <span class="s2">&quot;dropdown&quot;</span><span class="o">:</span>
                                    <span class="nx">fnEditor</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">editDropdown</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                <span class="k">case</span> <span class="s2">&quot;radio&quot;</span><span class="o">:</span>
                                    <span class="nx">fnEditor</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">editRadio</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                <span class="k">case</span> <span class="s2">&quot;textarea&quot;</span><span class="o">:</span>
                                    <span class="nx">fnEditor</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">editTextarea</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                <span class="k">case</span> <span class="s2">&quot;textbox&quot;</span><span class="o">:</span>
                                    <span class="nx">fnEditor</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">editTextbox</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                <span class="k">default</span><span class="o">:</span>
                                    <span class="nx">fnEditor</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isFunction</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">))</span> <span class="p">{</span>
                            <span class="nx">fnEditor</span> <span class="o">=</span> <span class="nx">oColumn</span><span class="p">.</span><span class="nx">editor</span><span class="p">;</span>
                        <span class="p">}</span>
            
                        <span class="k">if</span><span class="p">(</span><span class="nx">fnEditor</span><span class="p">)</span> <span class="p">{</span>
                            <span class="c1">// Create DOM input elements</span>
                            <span class="nx">fnEditor</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">,</span> <span class="k">this</span><span class="p">);</span>
            
                            <span class="c1">// Show Save/Cancel buttons</span>
                            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editorOptions</span> <span class="o">||</span> <span class="o">!</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">editorOptions</span><span class="p">.</span><span class="nx">disableBtns</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">this</span><span class="p">.</span><span class="nx">showCellEditorBtns</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">);</span>
                            <span class="p">}</span>
            
                            <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">isActive</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            
                            <span class="c1">//TODO: verify which args to pass</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorShowEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="nx">oCellEditor</span><span class="p">});</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Cell Editor shown for &quot;</span> <span class="o">+</span> <span class="nx">elCell</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                            <span class="k">return</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>



            
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Backward compatibility.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _initCellEditorEl</span>
<span class="cm"> * @private</span>
<span class="cm"> * @deprecated Use BaseCellEditor class.</span>
<span class="cm"> */</span>
<span class="nx">_initCellEditorEl</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Attach Cell Editor container element as first child of body</span>
    <span class="kd">var</span> <span class="nx">elCellEditor</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">);</span>
    <span class="nx">elCellEditor</span><span class="p">.</span><span class="nx">id</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span> <span class="o">+</span> <span class="s2">&quot;-celleditor&quot;</span><span class="p">;</span>
    <span class="nx">elCellEditor</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
    <span class="nx">elCellEditor</span><span class="p">.</span><span class="nx">tabIndex</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elCellEditor</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_EDITOR</span><span class="p">);</span>
    <span class="kd">var</span> <span class="nx">elFirstChild</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">getFirstChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elFirstChild</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">elCellEditor</span> <span class="o">=</span> <span class="nx">Dom</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">(</span><span class="nx">elCellEditor</span><span class="p">,</span> <span class="nx">elFirstChild</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">elCellEditor</span> <span class="o">=</span> <span class="nb">document</span><span class="p">.</span><span class="nx">body</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nx">elCellEditor</span><span class="p">);</span>
    <span class="p">}</span>
    
    <span class="c1">// Internal tracker of Cell Editor values</span>
    <span class="kd">var</span> <span class="nx">oCellEditor</span> <span class="o">=</span> <span class="p">{};</span>
    <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">container</span> <span class="o">=</span> <span class="nx">elCellEditor</span><span class="p">;</span>
    <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="nx">oCellEditor</span><span class="p">.</span><span class="nx">isActive</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span> <span class="o">=</span> <span class="nx">oCellEditor</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Overridable abstract method to customize CellEditor before showing.</span>
<span class="cm"> *</span>
<span class="cm"> * @method doBeforeShowCellEditor</span>
<span class="cm"> * @param oCellEditor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm"> * @return {Boolean} Return true to continue showing CellEditor.</span>
<span class="cm"> */</span>
<span class="nx">doBeforeShowCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oCellEditor</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Saves active CellEditor input to Record and upates DOM UI.</span>
<span class="cm"> *</span>
<span class="cm"> * @method saveCellEditor</span>
<span class="cm"> */</span>
<span class="nx">saveCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">save</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">save</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="c1">// Backward compatibility</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">isActive</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">newData</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">value</span><span class="p">;</span>
            <span class="c1">// Copy the data to pass to the event</span>
            <span class="c1">//var oldData = YAHOO.widget.DataTable._cloneObject(this._oCellEditor.record.getData(this._oCellEditor.column.key));</span>
            <span class="kd">var</span> <span class="nx">oldData</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">record</span><span class="p">.</span><span class="nx">getData</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">column</span><span class="p">.</span><span class="nx">key</span><span class="p">);</span>
    
            <span class="c1">// Validate input data</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">validator</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">newData</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">validator</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">,</span> <span class="nx">newData</span><span class="p">,</span> <span class="nx">oldData</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">);</span>
                <span class="k">if</span><span class="p">(</span><span class="nx">newData</span> <span class="o">===</span> <span class="kc">null</span> <span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">resetCellEditor</span><span class="p">();</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorRevertEvent&quot;</span><span class="p">,</span>
                            <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">oldData</span><span class="p">,</span> <span class="nx">newData</span><span class="o">:</span><span class="nx">newData</span><span class="p">});</span>
                    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not save Cell Editor input due to invalid data &quot;</span> <span class="o">+</span>
                            <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">newData</span><span class="p">),</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="c1">// Update the Record</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">updateRecordValue</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">record</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">column</span><span class="p">.</span><span class="nx">key</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">value</span><span class="p">);</span>
            <span class="c1">// Update the UI</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">formatCell</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">cell</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">record</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">column</span><span class="p">);</span>
            
            <span class="c1">// Bug fix 1764044</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">add</span><span class="p">({</span>
                <span class="nx">method</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">validateColumnWidths</span><span class="p">();</span>
                <span class="p">},</span>
                <span class="nx">scope</span><span class="o">:</span> <span class="k">this</span>
            <span class="p">});</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oChainRender</span><span class="p">.</span><span class="nx">run</span><span class="p">();</span>
            <span class="c1">// Clear out the Cell Editor</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">resetCellEditor</span><span class="p">();</span>
    
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorSaveEvent&quot;</span><span class="p">,</span>
                    <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">,</span> <span class="nx">oldData</span><span class="o">:</span><span class="nx">oldData</span><span class="p">,</span> <span class="nx">newData</span><span class="o">:</span><span class="nx">newData</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Cell Editor input saved&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>
    <span class="p">}</span>   
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Cancels active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method cancelCellEditor</span>
<span class="cm"> */</span>
<span class="nx">cancelCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="c1">// Backward compatibility</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">isActive</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">resetCellEditor</span><span class="p">();</span>
            <span class="c1">//TODO: preserve values for the event?</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorCancelEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">editor</span><span class="o">:</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">});</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Cell Editor input canceled&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
        <span class="p">}</span>

        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;CellEditor input canceled&quot;</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Destroys active CellEditor instance and UI.</span>
<span class="cm"> *</span>
<span class="cm"> * @method destroyCellEditor</span>
<span class="cm"> */</span>
<span class="nx">destroyCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">destroy</span><span class="p">();</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="p">}</span>   
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through showEvent of the active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorShowEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args.</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_onEditorShowEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorShowEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through keydownEvent of the active CellEditor.</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args. </span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorKeydownEvent</span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_onEditorKeydownEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorKeydownEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through revertEvent of the active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorRevertEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args. </span>
<span class="cm"> * @private  </span>
<span class="cm"> */</span>
<span class="nx">_onEditorRevertEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorRevertEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through saveEvent of the active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorSaveEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args.  </span>
<span class="cm"> * @private </span>
<span class="cm"> */</span>
<span class="nx">_onEditorSaveEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorSaveEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through cancelEvent of the active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorCancelEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args.</span>
<span class="cm"> * @private   </span>
<span class="cm"> */</span>
<span class="nx">_onEditorCancelEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorCancelEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through blurEvent of the active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorBlurEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args. </span>
<span class="cm"> * @private  </span>
<span class="cm"> */</span>
<span class="nx">_onEditorBlurEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorBlurEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through blockEvent of the active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorBlockEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args. </span>
<span class="cm"> * @private  </span>
<span class="cm"> */</span>
<span class="nx">_onEditorBlockEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorBlockEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Passes through unblockEvent of the active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method _onEditorUnblockEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args. </span>
<span class="cm"> * @private  </span>
<span class="cm"> */</span>
<span class="nx">_onEditorUnblockEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;editorUnblockEvent&quot;</span><span class="p">,</span> <span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Public handler of the editorBlurEvent. By default, saves on blur if</span>
<span class="cm"> * disableBtns is true, otherwise cancels on blur. </span>
<span class="cm"> *</span>
<span class="cm"> * @method onEditorBlurEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args.  </span>
<span class="cm"> */</span>
<span class="nx">onEditorBlurEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">disableBtns</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Save on blur</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">save</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// Backward incompatible</span>
            <span class="nx">oArgs</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">save</span><span class="p">();</span>
        <span class="p">}</span>
    <span class="p">}</span>      
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// Backward incompatible</span>
        <span class="c1">// Cancel on blur</span>
        <span class="nx">oArgs</span><span class="p">.</span><span class="nx">editor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">();</span>
    <span class="p">}</span>      
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Public handler of the editorBlockEvent. By default, disables DataTable UI.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEditorBlockEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args.  </span>
<span class="cm"> */</span>
<span class="nx">onEditorBlockEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">disable</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Public handler of the editorUnblockEvent. By default, undisables DataTable UI.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEditorUnblockEvent</span>
<span class="cm"> * @param oArgs {Object}  Custom Event args.  </span>
<span class="cm"> */</span>
<span class="nx">onEditorUnblockEvent</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">undisable</span><span class="p">();</span>
<span class="p">},</span>






































<span class="c1">// ABSTRACT METHODS</span>

<span class="cm">/**</span>
<span class="cm"> * Overridable method gives implementers a hook to access data before</span>
<span class="cm"> * it gets added to RecordSet and rendered to the TBODY.</span>
<span class="cm"> *</span>
<span class="cm"> * @method doBeforeLoadData</span>
<span class="cm"> * @param sRequest {String} Original request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} additional arguments</span>
<span class="cm"> * @return {Boolean} Return true to continue loading data into RecordSet and</span>
<span class="cm"> * updating DataTable with new Records, false to cancel.</span>
<span class="cm"> */</span>
<span class="nx">doBeforeLoadData</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
<span class="p">},</span>































































<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Public Custom Event Handlers</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to sort Column.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventSortColumn</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventSortColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
<span class="c1">//TODO: support form elements in sortable columns</span>
    <span class="kd">var</span> <span class="nx">evt</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">event</span><span class="p">;</span>
    <span class="kd">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">;</span>

    <span class="kd">var</span> <span class="nx">el</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getThEl</span><span class="p">(</span><span class="nx">target</span><span class="p">)</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">target</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">el</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="nx">el</span><span class="p">);</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">.</span><span class="nx">sortable</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">Ev</span><span class="p">.</span><span class="nx">stopEvent</span><span class="p">(</span><span class="nx">evt</span><span class="p">);</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">sortColumn</span><span class="p">(</span><span class="nx">oColumn</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not find Column for &quot;</span> <span class="o">+</span> <span class="nx">target</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to select Column.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventSelectColumn</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventSelectColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">selectColumn</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to highlight Column. Accounts for spurious</span>
<span class="cm"> * caused-by-child events. </span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventHighlightColumn</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventHighlightColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">highlightColumn</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to unhighlight Column. Accounts for spurious</span>
<span class="cm"> * caused-by-child events. </span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventUnhighlightColumn</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventUnhighlightColumn</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">unhighlightColumn</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to manage selection according to desktop paradigm.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventSelectRow</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventSelectRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sMode</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;selectionMode&quot;</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;single&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handleStandardSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to select cell.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventSelectCell</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventSelectCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">sMode</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;selectionMode&quot;</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellblock&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handleCellBlockSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">sMode</span> <span class="o">==</span> <span class="s2">&quot;cellrange&quot;</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handleCellRangeSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_handleSingleCellSelectionByMouse</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to highlight row. Accounts for spurious</span>
<span class="cm"> * caused-by-child events. </span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventHighlightRow</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventHighlightRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">highlightRow</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to unhighlight row. Accounts for spurious</span>
<span class="cm"> * caused-by-child events. </span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventUnhighlightRow</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventUnhighlightRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">unhighlightRow</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to highlight cell. Accounts for spurious</span>
<span class="cm"> * caused-by-child events. </span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventHighlightCell</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventHighlightCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">highlightCell</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to unhighlight cell. Accounts for spurious</span>
<span class="cm"> * caused-by-child events. </span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventUnhighlightCell</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventUnhighlightCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">unhighlightCell</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to format cell.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventFormatCell</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventFormatCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">target</span> <span class="o">=</span> <span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">;</span>

    <span class="kd">var</span> <span class="nx">elCell</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">target</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">elCell</span><span class="p">)</span> <span class="p">{</span>
        <span class="kd">var</span> <span class="nx">oColumn</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getColumn</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">getCellIndex</span><span class="p">(</span><span class="nx">elCell</span><span class="p">));</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">formatCell</span><span class="p">(</span><span class="nx">elCell</span><span class="p">.</span><span class="nx">firstChild</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRecord</span><span class="p">(</span><span class="nx">elCell</span><span class="p">),</span> <span class="nx">oColumn</span><span class="p">);</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Could not format cell &quot;</span> <span class="o">+</span> <span class="nx">target</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to edit cell.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventShowCellEditor</span>
<span class="cm"> * @param oArgs.event {HTMLEvent} Event object.</span>
<span class="cm"> * @param oArgs.target {HTMLElement} Target element.</span>
<span class="cm"> */</span>
<span class="nx">onEventShowCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">isDisabled</span><span class="p">())</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">showCellEditor</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">.</span><span class="nx">target</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to save active CellEditor input.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventSaveCellEditor</span>
<span class="cm"> */</span>
<span class="nx">onEventSaveCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">save</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">save</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="c1">// Backward compatibility</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">saveCellEditor</span><span class="p">();</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Custom event handler to cancel active CellEditor.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onEventCancelCellEditor</span>
<span class="cm"> */</span>
<span class="nx">onEventCancelCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">cancel</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="c1">// Backward compatibility</span>
        <span class="k">else</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">cancelCellEditor</span><span class="p">();</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Callback function receives data from DataSource and populates an entire</span>
<span class="cm"> * DataTable with Records and TR elements, clearing previous Records, if any.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onDataReturnInitializeTable</span>
<span class="cm"> * @param sRequest {String} Original request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} (optional) Additional argument(s)</span>
<span class="cm"> */</span>
<span class="nx">onDataReturnInitializeTable</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">initializeTable</span><span class="p">();</span>
    
        <span class="k">this</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span><span class="nx">oResponse</span><span class="p">,</span><span class="nx">oPayload</span><span class="p">);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Callback function receives reponse from DataSource, replaces all existing</span>
<span class="cm"> * Records in  RecordSet, updates TR elements with new data, and updates state</span>
<span class="cm"> * UI for pagination and sorting from payload data, if necessary. </span>
<span class="cm"> *  </span>
<span class="cm"> * @method onDataReturnReplaceRows</span>
<span class="cm"> * @param oRequest {MIXED} Original generated request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} (optional) Additional argument(s)</span>
<span class="cm"> */</span>
<span class="nx">onDataReturnReplaceRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;dataReturnEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">request</span><span class="o">:</span><span class="nx">oRequest</span><span class="p">,</span><span class="nx">response</span><span class="o">:</span><span class="nx">oResponse</span><span class="p">,</span><span class="nx">payload</span><span class="o">:</span><span class="nx">oPayload</span><span class="p">});</span>
    
        <span class="c1">// Pass data through abstract method for any transformations</span>
        <span class="kd">var</span> <span class="nx">ok</span>    <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeLoadData</span><span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">),</span>
            <span class="nx">pag</span>   <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">),</span>
            <span class="nx">index</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
    
        <span class="c1">// Data ok to set</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// Update Records</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">reset</span><span class="p">();</span>
    
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;dynamicData&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">oPayload</span> <span class="o">&amp;&amp;</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span> <span class="o">&amp;&amp;</span>
                    <span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">recordOffset</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">index</span> <span class="o">=</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">recordOffset</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">pag</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">index</span> <span class="o">=</span> <span class="nx">pag</span><span class="p">.</span><span class="nx">getStartIndex</span><span class="p">();</span>
                <span class="p">}</span>
            <span class="p">}</span>
    
            <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">setRecords</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">,</span> <span class="nx">index</span> <span class="o">|</span> <span class="mi">0</span><span class="p">);</span>
            
            <span class="c1">// Update state</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleDataReturnPayload</span><span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
            
            <span class="c1">// Update UI</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>    
        <span class="p">}</span>
        <span class="c1">// Error</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_ERROR&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ERROR</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Callback function receives data from DataSource and appends to an existing</span>
<span class="cm"> * DataTable new Records and, if applicable, creates or updates</span>
<span class="cm"> * corresponding TR elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onDataReturnAppendRows</span>
<span class="cm"> * @param sRequest {String} Original request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} (optional) Additional argument(s)</span>
<span class="cm"> */</span>
<span class="nx">onDataReturnAppendRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;dataReturnEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">request</span><span class="o">:</span><span class="nx">sRequest</span><span class="p">,</span><span class="nx">response</span><span class="o">:</span><span class="nx">oResponse</span><span class="p">,</span><span class="nx">payload</span><span class="o">:</span><span class="nx">oPayload</span><span class="p">});</span>
    
        <span class="c1">// Pass data through abstract method for any transformations</span>
        <span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeLoadData</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
    
        <span class="c1">// Data ok to append</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">))</span> <span class="p">{</span>        
            <span class="c1">// Append rows</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">addRows</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">);</span>
    
            <span class="c1">// Update state</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleDataReturnPayload</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// Error</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_ERROR&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ERROR</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Callback function receives data from DataSource and inserts new records</span>
<span class="cm"> * starting at the index specified in oPayload.insertIndex. The value for</span>
<span class="cm"> * oPayload.insertIndex can be populated when sending the request to the DataSource,</span>
<span class="cm"> * or by accessing oPayload.insertIndex with the doBeforeLoadData() method at runtime.</span>
<span class="cm"> * If applicable, creates or updates corresponding TR elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onDataReturnInsertRows</span>
<span class="cm"> * @param sRequest {String} Original request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} Argument payload, looks in oPayload.insertIndex.</span>
<span class="cm"> */</span>
<span class="nx">onDataReturnInsertRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;dataReturnEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">request</span><span class="o">:</span><span class="nx">sRequest</span><span class="p">,</span><span class="nx">response</span><span class="o">:</span><span class="nx">oResponse</span><span class="p">,</span><span class="nx">payload</span><span class="o">:</span><span class="nx">oPayload</span><span class="p">});</span>
    
        <span class="c1">// Pass data through abstract method for any transformations</span>
        <span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeLoadData</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
    
        <span class="c1">// Data ok to append</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// Insert rows</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">addRows</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">,</span> <span class="p">(</span><span class="nx">oPayload</span> <span class="o">?</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">insertIndex</span> <span class="o">:</span> <span class="mi">0</span><span class="p">));</span>
    
            <span class="c1">// Update state</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleDataReturnPayload</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// Error</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_ERROR&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ERROR</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Callback function receives data from DataSource and incrementally updates Records</span>
<span class="cm"> * starting at the index specified in oPayload.updateIndex. The value for</span>
<span class="cm"> * oPayload.updateIndex can be populated when sending the request to the DataSource,</span>
<span class="cm"> * or by accessing oPayload.updateIndex with the doBeforeLoadData() method at runtime.</span>
<span class="cm"> * If applicable, creates or updates corresponding TR elements.</span>
<span class="cm"> *</span>
<span class="cm"> * @method onDataReturnUpdateRows</span>
<span class="cm"> * @param sRequest {String} Original request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} Argument payload, looks in oPayload.updateIndex.</span>
<span class="cm"> */</span>
<span class="nx">onDataReturnUpdateRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;dataReturnEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">request</span><span class="o">:</span><span class="nx">sRequest</span><span class="p">,</span><span class="nx">response</span><span class="o">:</span><span class="nx">oResponse</span><span class="p">,</span><span class="nx">payload</span><span class="o">:</span><span class="nx">oPayload</span><span class="p">});</span>
    
        <span class="c1">// Pass data through abstract method for any transformations</span>
        <span class="kd">var</span> <span class="nx">ok</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeLoadData</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
    
        <span class="c1">// Data ok to append</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// Insert rows</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">updateRows</span><span class="p">((</span><span class="nx">oPayload</span> <span class="o">?</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">updateIndex</span> <span class="o">:</span> <span class="mi">0</span><span class="p">),</span> <span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">);</span>
    
            <span class="c1">// Update state</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleDataReturnPayload</span><span class="p">(</span><span class="nx">sRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// Error</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_ERROR&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ERROR</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Callback function receives reponse from DataSource and populates the</span>
<span class="cm"> * RecordSet with the results.</span>
<span class="cm"> *  </span>
<span class="cm"> * @method onDataReturnSetRows</span>
<span class="cm"> * @param oRequest {MIXED} Original generated request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} (optional) Additional argument(s)</span>
<span class="cm"> */</span>
<span class="nx">onDataReturnSetRows</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">if</span><span class="p">((</span><span class="k">this</span> <span class="k">instanceof</span> <span class="nx">DT</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">_sId</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">fireEvent</span><span class="p">(</span><span class="s2">&quot;dataReturnEvent&quot;</span><span class="p">,</span> <span class="p">{</span><span class="nx">request</span><span class="o">:</span><span class="nx">oRequest</span><span class="p">,</span><span class="nx">response</span><span class="o">:</span><span class="nx">oResponse</span><span class="p">,</span><span class="nx">payload</span><span class="o">:</span><span class="nx">oPayload</span><span class="p">});</span>
    
        <span class="c1">// Pass data through abstract method for any transformations</span>
        <span class="kd">var</span> <span class="nx">ok</span>    <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">doBeforeLoadData</span><span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">),</span>
            <span class="nx">pag</span>   <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">),</span>
            <span class="nx">index</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
    
        <span class="c1">// Data ok to set</span>
        <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span> <span class="o">&amp;&amp;</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">))</span> <span class="p">{</span>
            <span class="c1">// Update Records</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;dynamicData&#39;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">oPayload</span> <span class="o">&amp;&amp;</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span> <span class="o">&amp;&amp;</span>
                    <span class="nx">lang</span><span class="p">.</span><span class="nx">isNumber</span><span class="p">(</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">recordOffset</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">index</span> <span class="o">=</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">recordOffset</span><span class="p">;</span>
                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">pag</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">index</span> <span class="o">=</span> <span class="nx">pag</span><span class="p">.</span><span class="nx">getStartIndex</span><span class="p">();</span>
                <span class="p">}</span>
                
                <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">reset</span><span class="p">();</span> <span class="c1">// Bug 2290604: dyanmic data shouldn&#39;t keep accumulating by default</span>
            <span class="p">}</span>
    
            <span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">setRecords</span><span class="p">(</span><span class="nx">oResponse</span><span class="p">.</span><span class="nx">results</span><span class="p">,</span> <span class="nx">index</span> <span class="o">|</span> <span class="mi">0</span><span class="p">);</span>
    
            <span class="c1">// Update state</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_handleDataReturnPayload</span><span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
            
            <span class="c1">// Update UI</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
        <span class="p">}</span>
        <span class="c1">// Error</span>
        <span class="k">else</span> <span class="k">if</span><span class="p">(</span><span class="nx">ok</span> <span class="o">&amp;&amp;</span> <span class="nx">oResponse</span><span class="p">.</span><span class="nx">error</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">showTableMessage</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;MSG_ERROR&quot;</span><span class="p">),</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_ERROR</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
    <span class="k">else</span> <span class="p">{</span>
        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;Instance destroyed before data returned.&quot;</span><span class="p">,</span><span class="s2">&quot;info&quot;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Hook to update oPayload before consumption.</span>
<span class="cm"> *  </span>
<span class="cm"> * @method handleDataReturnPayload</span>
<span class="cm"> * @param oRequest {MIXED} Original generated request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} State values.</span>
<span class="cm"> * @return oPayload {MIXED} State values.</span>
<span class="cm"> */</span>
<span class="nx">handleDataReturnPayload</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">return</span> <span class="nx">oPayload</span> <span class="o">||</span> <span class="p">{};</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * Updates the DataTable with state data sent in an onDataReturn* payload.</span>
<span class="cm"> *  </span>
<span class="cm"> * @method _handleDataReturnPayload</span>
<span class="cm"> * @param oRequest {MIXED} Original generated request.</span>
<span class="cm"> * @param oResponse {Object} &lt;a href=&quot;http://developer.yahoo.com/yui/datasource/#ds_oParsedResponse&quot;&gt;Response object&lt;/a&gt;.</span>
<span class="cm"> * @param oPayload {MIXED} State values</span>
<span class="cm"> * @private</span>
<span class="cm"> */</span>
<span class="nx">_handleDataReturnPayload</span> <span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
    <span class="nx">oPayload</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">handleDataReturnPayload</span><span class="p">(</span><span class="nx">oRequest</span><span class="p">,</span> <span class="nx">oResponse</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">);</span>
    <span class="k">if</span><span class="p">(</span><span class="nx">oPayload</span><span class="p">)</span> <span class="p">{</span>
        <span class="c1">// Update pagination</span>
        <span class="kd">var</span> <span class="nx">oPaginator</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s1">&#39;paginator&#39;</span><span class="p">);</span>
        <span class="k">if</span> <span class="p">(</span><span class="nx">oPaginator</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Update totalRecords</span>
            <span class="k">if</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">get</span><span class="p">(</span><span class="s2">&quot;dynamicData&quot;</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">widget</span><span class="p">.</span><span class="nx">Paginator</span><span class="p">.</span><span class="nx">isNumeric</span><span class="p">(</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">totalRecords</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">,</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">totalRecords</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>
            <span class="k">else</span> <span class="p">{</span>
                <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;totalRecords&#39;</span><span class="p">,</span><span class="k">this</span><span class="p">.</span><span class="nx">_oRecordSet</span><span class="p">.</span><span class="nx">getLength</span><span class="p">());</span>
            <span class="p">}</span>
            <span class="c1">// Update other paginator values</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isObject</span><span class="p">(</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;rowsPerPage&#39;</span><span class="p">,</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">rowsPerPage</span><span class="p">);</span>
                <span class="nx">oPaginator</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;recordOffset&#39;</span><span class="p">,</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">pagination</span><span class="p">.</span><span class="nx">recordOffset</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">}</span>

        <span class="c1">// Update sorting</span>
        <span class="k">if</span> <span class="p">(</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Set the sorting values in preparation for refresh</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;sortedBy&#39;</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">sortedBy</span><span class="p">);</span>
        <span class="p">}</span>
        <span class="c1">// Backwards compatibility for sorting</span>
        <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">oPayload</span><span class="p">.</span><span class="nx">sorting</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// Set the sorting values in preparation for refresh</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">set</span><span class="p">(</span><span class="s1">&#39;sortedBy&#39;</span><span class="p">,</span> <span class="nx">oPayload</span><span class="p">.</span><span class="nx">sorting</span><span class="p">);</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>

































    <span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
    <span class="c1">//</span>
    <span class="c1">// Custom Events</span>
    <span class="c1">//</span>
    <span class="c1">/////////////////////////////////////////////////////////////////////////////</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable&#39;s rows are rendered from an initialized state.</span>
<span class="cm">     *</span>
<span class="cm">     * @event initEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired before the DataTable&#39;s DOM is rendered or modified.</span>
<span class="cm">     *</span>
<span class="cm">     * @event beforeRenderEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable&#39;s DOM is rendered or modified.</span>
<span class="cm">     *</span>
<span class="cm">     * @event renderEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable&#39;s post-render routine is complete, including</span>
<span class="cm">     * Column width validations.</span>
<span class="cm">     *</span>
<span class="cm">     * @event postRenderEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable is disabled.</span>
<span class="cm">     *</span>
<span class="cm">     * @event disableEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable is undisabled.</span>
<span class="cm">     *</span>
<span class="cm">     * @event undisableEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when data is returned from DataSource but before it is consumed by</span>
<span class="cm">     * DataTable.</span>
<span class="cm">     *</span>
<span class="cm">     * @event dataReturnEvent</span>
<span class="cm">     * @param oArgs.request {String} Original request.</span>
<span class="cm">     * @param oArgs.response {Object} Response object.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a focus event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableFocusEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable THEAD element has a focus event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadFocusEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable TBODY element has a focus event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tbodyFocusEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a blur event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableBlurEvent</span>
<span class="cm">     */</span>

    <span class="cm">/*TODO implement theadBlurEvent</span>
<span class="cm">     * Fired when the DataTable THEAD element has a blur event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadBlurEvent</span>
<span class="cm">     */</span>

    <span class="cm">/*TODO: implement tbodyBlurEvent</span>
<span class="cm">     * Fired when the DataTable TBODY element has a blur event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tbodyBlurEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a key event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableKeyEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable THEAD element has a key event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadKeyEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable TBODY element has a key event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tbodyKeyEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a mouseover.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableMouseoverEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a mouseout.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableMouseoutEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a mousedown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableMousedownEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a mouseup.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableMouseupEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a click.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable has a dblclick.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableDblclickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The DataTable&#39;s TABLE element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a message is shown in the DataTable&#39;s message element.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableMsgShowEvent</span>
<span class="cm">     * @param oArgs.html {HTML} The HTML displayed.</span>
<span class="cm">     * @param oArgs.className {String} The className assigned.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when the DataTable&#39;s message element is hidden.</span>
<span class="cm">     *</span>
<span class="cm">     * @event tableMsgHideEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD row has a mouseover.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadRowMouseoverEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD row has a mouseout.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadRowMouseoutEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD row has a mousedown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadRowMousedownEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD row has a mouseup.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadRowMouseupEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD row has a click.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadRowClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD row has a dblclick.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadRowDblclickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD cell has a mouseover.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadCellMouseoverEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TH element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD cell has a mouseout.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadCellMouseoutEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TH element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD cell has a mousedown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadCellMousedownEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TH element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD cell has a mouseup.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadCellMouseupEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TH element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD cell has a click.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadCellClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TH element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD cell has a dblclick.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadCellDblclickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TH element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD label has a mouseover.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadLabelMouseoverEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The SPAN element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD label has a mouseout.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadLabelMouseoutEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The SPAN element.</span>
<span class="cm">     *</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD label has a mousedown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadLabelMousedownEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The SPAN element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD label has a mouseup.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadLabelMouseupEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The SPAN element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD label has a click.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadLabelClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The SPAN element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a THEAD label has a dblclick.</span>
<span class="cm">     *</span>
<span class="cm">     * @event theadLabelDblclickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The SPAN element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is sorted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnSortEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     * @param oArgs.dir {String} Sort direction: YAHOO.widget.DataTable.CLASS_ASC</span>
<span class="cm">     * or YAHOO.widget.DataTable.CLASS_DESC.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column width is set.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnSetWidthEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     * @param oArgs.width {Number} The width in pixels.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column width is unset.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnUnsetWidthEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is drag-resized.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnResizeEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TH element.</span>
<span class="cm">     * @param oArgs.width {Number} Width in pixels.     </span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a Column is moved to a new index.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnReorderEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     * @param oArgs.oldIndex {Number} The previous tree index position.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is hidden.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnHideEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is shown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnShowEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is selected.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnSelectEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is unselected.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnUnselectEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     */</span>
    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is removed.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnRemoveEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is inserted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnInsertEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The Column instance.</span>
<span class="cm">     * @param oArgs.index {Number} The index position.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is highlighted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnHighlightEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The highlighted Column.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a column is unhighlighted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event columnUnhighlightEvent</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The unhighlighted Column.</span>
<span class="cm">     */</span>


    <span class="cm">/**</span>
<span class="cm">     * Fired when a row has a mouseover.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowMouseoverEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row has a mouseout.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowMouseoutEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row has a mousedown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowMousedownEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row has a mouseup.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowMouseupEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row has a click.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row has a dblclick.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowDblclickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TR element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row is added.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowAddEvent</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The added Record.</span>
<span class="cm">     */</span>
     
    <span class="cm">/**</span>
<span class="cm">     * Fired when rows are added.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowsAddEvent</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record[]} The added Records.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row is updated.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowUpdateEvent</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The updated Record.</span>
<span class="cm">     * @param oArgs.oldData {Object} Object literal of the old data.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row is deleted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowDeleteEvent</span>
<span class="cm">     * @param oArgs.oldData {Object} Object literal of the deleted data.</span>
<span class="cm">     * @param oArgs.recordIndex {Number} Index of the deleted Record.</span>
<span class="cm">     * @param oArgs.trElIndex {Number} Index of the deleted TR element, if on current page.</span>
<span class="cm">     */</span>
     
    <span class="cm">/**</span>
<span class="cm">     * Fired when rows are deleted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowsDeleteEvent</span>
<span class="cm">     * @param oArgs.oldData {Object[]} Array of object literals of the deleted data.</span>
<span class="cm">     * @param oArgs.recordIndex {Number} Index of the first deleted Record.</span>
<span class="cm">     * @param oArgs.count {Number} Number of deleted Records.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row is selected.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowSelectEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The selected TR element, if applicable.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The selected Record.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row is unselected.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowUnselectEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The unselected TR element, if applicable.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The unselected Record.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when all row selections are cleared.</span>
<span class="cm">     *</span>
<span class="cm">     * @event unselectAllRowsEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row is highlighted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowHighlightEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The highlighted TR element.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a row is unhighlighted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event rowUnhighlightEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The highlighted TR element.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The highlighted Record.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell is updated.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellUpdateEvent</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The updated Record.</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The updated Column.</span>
<span class="cm">     * @param oArgs.oldData {Object} Original data value of the updated cell.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell has a mouseover.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellMouseoverEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TD element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell has a mouseout.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellMouseoutEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TD element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell has a mousedown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellMousedownEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TD element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell has a mouseup.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellMouseupEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TD element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell has a click.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TD element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell has a dblclick.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellDblclickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The TD element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell is formatted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellFormatEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The formatted TD element.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.</span>
<span class="cm">     * @param oArgs.key {String} (deprecated) The key of the formatted cell.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell is selected.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellSelectEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The selected TD element.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.</span>
<span class="cm">     * @param oArgs.key {String} (deprecated) The key of the selected cell.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell is unselected.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellUnselectEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The unselected TD element.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The associated Record.</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.</span>
<span class="cm">     * @param oArgs.key {String} (deprecated) The key of the unselected cell.</span>

<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell is highlighted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellHighlightEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The highlighted TD element.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.</span>
<span class="cm">     * @param oArgs.key {String} (deprecated) The key of the highlighted cell.</span>

<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a cell is unhighlighted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event cellUnhighlightEvent</span>
<span class="cm">     * @param oArgs.el {HTMLElement} The unhighlighted TD element.</span>
<span class="cm">     * @param oArgs.record {YAHOO.widget.Record} The associated Record instance.</span>
<span class="cm">     * @param oArgs.column {YAHOO.widget.Column} The associated Column instance.</span>
<span class="cm">     * @param oArgs.key {String} (deprecated) The key of the unhighlighted cell.</span>

<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when all cell selections are cleared.</span>
<span class="cm">     *</span>
<span class="cm">     * @event unselectAllCellsEvent</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor is shown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorShowEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor has a keydown.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorKeydownEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor input is reverted.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorRevertEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     * @param oArgs.newData {Object} New data value from form input field.</span>
<span class="cm">     * @param oArgs.oldData {Object} Old data value.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor input is saved.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorSaveEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     * @param oArgs.newData {Object} New data value from form input field.</span>
<span class="cm">     * @param oArgs.oldData {Object} Old data value.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor input is canceled.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorCancelEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor has a blur event.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorBlurEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor is blocked.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorBlockEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CellEditor is unblocked.</span>
<span class="cm">     *</span>
<span class="cm">     * @event editorUnblockEvent</span>
<span class="cm">     * @param oArgs.editor {YAHOO.widget.CellEditor} The CellEditor instance.</span>
<span class="cm">     */</span>





    <span class="cm">/**</span>
<span class="cm">     * Fired when a link is clicked.</span>
<span class="cm">     *</span>
<span class="cm">     * @event linkClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The A element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a BUTTON element or INPUT element of type &quot;button&quot;, &quot;image&quot;,</span>
<span class="cm">     * &quot;submit&quot;, &quot;reset&quot; is clicked.</span>
<span class="cm">     *</span>
<span class="cm">     * @event buttonClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The BUTTON element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a CHECKBOX element is clicked.</span>
<span class="cm">     *</span>
<span class="cm">     * @event checkboxClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The CHECKBOX element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a SELECT element is changed.</span>
<span class="cm">     *</span>
<span class="cm">     * @event dropdownChangeEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The SELECT element.</span>
<span class="cm">     */</span>

    <span class="cm">/**</span>
<span class="cm">     * Fired when a RADIO element is clicked.</span>
<span class="cm">     *</span>
<span class="cm">     * @event radioClickEvent</span>
<span class="cm">     * @param oArgs.event {HTMLEvent} The event object.</span>
<span class="cm">     * @param oArgs.target {HTMLElement} The RADIO element.</span>
<span class="cm">     */</span>


























<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Deprecated APIs</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
  
<span class="cm">/*</span>
<span class="cm"> * @method showCellEditorBtns</span>
<span class="cm"> * @deprecated Use CellEditor.renderBtns() </span>
<span class="cm"> */</span>
<span class="nx">showCellEditorBtns</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Buttons</span>
    <span class="kd">var</span> <span class="nx">elBtnsDiv</span> <span class="o">=</span> <span class="nx">elContainer</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;div&quot;</span><span class="p">));</span>
    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elBtnsDiv</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_BUTTON</span><span class="p">);</span>

    <span class="c1">// Save button</span>
    <span class="kd">var</span> <span class="nx">elSaveBtn</span> <span class="o">=</span> <span class="nx">elBtnsDiv</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;button&quot;</span><span class="p">));</span>
    <span class="nx">Dom</span><span class="p">.</span><span class="nx">addClass</span><span class="p">(</span><span class="nx">elSaveBtn</span><span class="p">,</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">CLASS_DEFAULT</span><span class="p">);</span>
    <span class="nx">elSaveBtn</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;OK&quot;</span><span class="p">;</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elSaveBtn</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">onEventSaveCellEditor</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">);</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">focusTbodyEl</span><span class="p">();</span>
    <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

    <span class="c1">// Cancel button</span>
    <span class="kd">var</span> <span class="nx">elCancelBtn</span> <span class="o">=</span> <span class="nx">elBtnsDiv</span><span class="p">.</span><span class="nx">appendChild</span><span class="p">(</span><span class="nb">document</span><span class="p">.</span><span class="nx">createElement</span><span class="p">(</span><span class="s2">&quot;button&quot;</span><span class="p">));</span>
    <span class="nx">elCancelBtn</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;Cancel&quot;</span><span class="p">;</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">addListener</span><span class="p">(</span><span class="nx">elCancelBtn</span><span class="p">,</span> <span class="s2">&quot;click&quot;</span><span class="p">,</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">)</span> <span class="p">{</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">onEventCancelCellEditor</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">,</span> <span class="nx">oSelf</span><span class="p">);</span>
        <span class="nx">oSelf</span><span class="p">.</span><span class="nx">focusTbodyEl</span><span class="p">();</span>
    <span class="p">},</span> <span class="k">this</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method showCellEditorBtns() has been deprecated.&quot;</span> <span class="o">+</span>
            <span class="s2">&quot; Please use the CellEditor class.&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @method resetCellEditor</span>
<span class="cm"> * @deprecated Use destroyCellEditor </span>
<span class="cm"> */</span>
<span class="nx">resetCellEditor</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">var</span> <span class="nx">elContainer</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">container</span><span class="p">;</span>
    <span class="nx">elContainer</span><span class="p">.</span><span class="nx">style</span><span class="p">.</span><span class="nx">display</span> <span class="o">=</span> <span class="s2">&quot;none&quot;</span><span class="p">;</span>
    <span class="nx">Ev</span><span class="p">.</span><span class="nx">purgeElement</span><span class="p">(</span><span class="nx">elContainer</span><span class="p">,</span> <span class="kc">true</span><span class="p">);</span>
    <span class="nx">elContainer</span><span class="p">.</span><span class="nx">innerHTML</span> <span class="o">=</span> <span class="s2">&quot;&quot;</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">value</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">_oCellEditor</span><span class="p">.</span><span class="nx">isActive</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method resetCellEditor() has been deprecated.&quot;</span> <span class="o">+</span>
            <span class="s2">&quot; Please use the CellEditor class.&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @event editorUpdateEvent</span>
<span class="cm"> * @deprecated Use CellEditor class.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @method getBody</span>
<span class="cm"> * @deprecated Use getTbodyEl().</span>
<span class="cm"> */</span>
<span class="nx">getBody</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method getBody() has been deprecated&quot;</span> <span class="o">+</span>
            <span class="s2">&quot; in favor of getTbodyEl()&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTbodyEl</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @method getCell</span>
<span class="cm"> * @deprecated Use getTdEl().</span>
<span class="cm"> */</span>
<span class="nx">getCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method getCell() has been deprecated&quot;</span> <span class="o">+</span>
            <span class="s2">&quot; in favor of getTdEl()&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTdEl</span><span class="p">(</span><span class="nx">index</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @method getRow</span>
<span class="cm"> * @deprecated Use getTrEl().</span>
<span class="cm"> */</span>
<span class="nx">getRow</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">index</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method getRow() has been deprecated&quot;</span> <span class="o">+</span>
            <span class="s2">&quot; in favor of getTrEl()&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">getTrEl</span><span class="p">(</span><span class="nx">index</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @method refreshView</span>
<span class="cm"> * @deprecated Use render.</span>
<span class="cm"> */</span>
<span class="nx">refreshView</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method refreshView() has been deprecated&quot;</span> <span class="o">+</span>
            <span class="s2">&quot; in favor of render()&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">render</span><span class="p">();</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @method select</span>
<span class="cm"> * @deprecated Use selectRow.</span>
<span class="cm"> */</span>
<span class="nx">select</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">els</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method select() has been deprecated&quot;</span> <span class="o">+</span>
            <span class="s2">&quot; in favor of selectRow()&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isArray</span><span class="p">(</span><span class="nx">els</span><span class="p">))</span> <span class="p">{</span>
        <span class="nx">els</span> <span class="o">=</span> <span class="p">[</span><span class="nx">els</span><span class="p">];</span>
    <span class="p">}</span>
    <span class="k">for</span><span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">els</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">++</span><span class="p">)</span> <span class="p">{</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">selectRow</span><span class="p">(</span><span class="nx">els</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
    <span class="p">}</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @method onEventEditCell</span>
<span class="cm"> * @deprecated Use onEventShowCellEditor.</span>
<span class="cm"> */</span>
<span class="nx">onEventEditCell</span> <span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">)</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method onEventEditCell() has been deprecated&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; in favor of onEventShowCellEditor()&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">onEventShowCellEditor</span><span class="p">(</span><span class="nx">oArgs</span><span class="p">);</span>
<span class="p">},</span>

<span class="cm">/**</span>
<span class="cm"> * @method _syncColWidths</span>
<span class="cm"> * @deprecated Use validateColumnWidths.</span>
<span class="cm"> */</span>
<span class="nx">_syncColWidths</span> <span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
    <span class="c1">// Backward compatibility</span>
    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s2">&quot;The method _syncColWidths() has been deprecated&quot;</span> <span class="o">+</span>
        <span class="s2">&quot; in favor of validateColumnWidths()&quot;</span><span class="p">,</span> <span class="s2">&quot;warn&quot;</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">toString</span><span class="p">());</span>
    <span class="k">this</span><span class="p">.</span><span class="nx">validateColumnWidths</span><span class="p">();</span>
<span class="p">}</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerRowMouseoverEvent</span>
<span class="cm"> * @deprecated Use theadRowMouseoverEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerRowMouseoutEvent</span>
<span class="cm"> * @deprecated Use theadRowMouseoutEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerRowMousedownEvent</span>
<span class="cm"> * @deprecated Use theadRowMousedownEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerRowClickEvent</span>
<span class="cm"> * @deprecated Use theadRowClickEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerRowDblclickEvent</span>
<span class="cm"> * @deprecated Use theadRowDblclickEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerCellMouseoverEvent</span>
<span class="cm"> * @deprecated Use theadCellMouseoverEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerCellMouseoutEvent</span>
<span class="cm"> * @deprecated Use theadCellMouseoutEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerCellMousedownEvent</span>
<span class="cm"> * @deprecated Use theadCellMousedownEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerCellClickEvent</span>
<span class="cm"> * @deprecated Use theadCellClickEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerCellDblclickEvent</span>
<span class="cm"> * @deprecated Use theadCellDblclickEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerLabelMouseoverEvent</span>
<span class="cm"> * @deprecated Use theadLabelMouseoverEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerLabelMouseoutEvent</span>
<span class="cm"> * @deprecated Use theadLabelMouseoutEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerLabelMousedownEvent</span>
<span class="cm"> * @deprecated Use theadLabelMousedownEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerLabelClickEvent</span>
<span class="cm"> * @deprecated Use theadLabelClickEvent.</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * @event headerLabelDbllickEvent</span>
<span class="cm"> * @deprecated Use theadLabelDblclickEvent.</span>
<span class="cm"> */</span>

<span class="p">});</span>

<span class="cm">/**</span>
<span class="cm"> * Alias for onDataReturnSetRows for backward compatibility</span>
<span class="cm"> * @method onDataReturnSetRecords</span>
<span class="cm"> * @deprecated Use onDataReturnSetRows</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">onDataReturnSetRecords</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">onDataReturnSetRows</span><span class="p">;</span>

<span class="cm">/**</span>
<span class="cm"> * Alias for onPaginatorChange for backward compatibility</span>
<span class="cm"> * @method onPaginatorChange</span>
<span class="cm"> * @deprecated Use onPaginatorChangeRequest</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">onPaginatorChange</span> <span class="o">=</span> <span class="nx">DT</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">onPaginatorChangeRequest</span><span class="p">;</span>

<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="c1">//</span>
<span class="c1">// Deprecated static APIs</span>
<span class="c1">//</span>
<span class="c1">/////////////////////////////////////////////////////////////////////////////</span>
<span class="cm">/**</span>
<span class="cm"> * @method DataTable.editCheckbox</span>
<span class="cm"> * @deprecated  Use YAHOO.widget.CheckboxCellEditor.</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">editCheckbox</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span>

<span class="cm">/**</span>
<span class="cm"> * @method DataTable.editDate</span>
<span class="cm"> * @deprecated Use YAHOO.widget.DateCellEditor.</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">editDate</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span>

<span class="cm">/**</span>
<span class="cm"> * @method DataTable.editDropdown</span>
<span class="cm"> * @deprecated Use YAHOO.widget.DropdownCellEditor.</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">editDropdown</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span>

<span class="cm">/**</span>
<span class="cm"> * @method DataTable.editRadio</span>
<span class="cm"> * @deprecated Use YAHOO.widget.RadioCellEditor.</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">editRadio</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span>

<span class="cm">/**</span>
<span class="cm"> * @method DataTable.editTextarea</span>
<span class="cm"> * @deprecated Use YAHOO.widget.TextareaCellEditor</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">editTextarea</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span>

<span class="cm">/**</span>
<span class="cm"> * @method DataTable.editTextbox</span>
<span class="cm"> * @deprecated Use YAHOO.widget.TextboxCellEditor</span>
<span class="cm"> */</span>
<span class="nx">DT</span><span class="p">.</span><span class="nx">editTextbox</span><span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{};</span>

<span class="p">})();</span>
</pre></div>

                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class="selected"><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_datemath.html" title="datemath">datemath</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
                                <li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_storage.html" title="Storage">Storage</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class=""><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.util.Chain.html" title="YAHOO.util.Chain">YAHOO.util.Chain</a></li>
                                <li class=""><a href="YAHOO.util.ColumnDD.html" title="YAHOO.util.ColumnDD">YAHOO.util.ColumnDD</a></li>
                                <li class=""><a href="YAHOO.util.ColumnResizer.html" title="YAHOO.util.ColumnResizer">YAHOO.util.ColumnResizer</a></li>
                                <li class=""><a href="YAHOO.util.Sort.html" title="YAHOO.util.Sort">YAHOO.util.Sort</a></li>
                                <li class=""><a href="YAHOO.widget.BaseCellEditor.html" title="YAHOO.widget.BaseCellEditor">YAHOO.widget.BaseCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.CellEditor.html" title="YAHOO.widget.CellEditor">YAHOO.widget.CellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.CheckboxCellEditor.html" title="YAHOO.widget.CheckboxCellEditor">YAHOO.widget.CheckboxCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.Column.html" title="YAHOO.widget.Column">YAHOO.widget.Column</a></li>
                                <li class=""><a href="YAHOO.widget.ColumnSet.html" title="YAHOO.widget.ColumnSet">YAHOO.widget.ColumnSet</a></li>
                                <li class=""><a href="YAHOO.widget.DataTable.html" title="YAHOO.widget.DataTable">YAHOO.widget.DataTable</a></li>
                                <li class=""><a href="YAHOO.widget.DateCellEditor.html" title="YAHOO.widget.DateCellEditor">YAHOO.widget.DateCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.DropdownCellEditor.html" title="YAHOO.widget.DropdownCellEditor">YAHOO.widget.DropdownCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.RadioCellEditor.html" title="YAHOO.widget.RadioCellEditor">YAHOO.widget.RadioCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.TextareaCellEditor.html" title="YAHOO.widget.TextareaCellEditor">YAHOO.widget.TextareaCellEditor</a></li>
                                <li class=""><a href="YAHOO.widget.TextboxCellEditor.html" title="YAHOO.widget.TextboxCellEditor">YAHOO.widget.TextboxCellEditor</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class=""><a href="CellEditor.js.html" title="CellEditor.js">CellEditor.js</a></li>
                                <li class=""><a href="Chain.js.html" title="Chain.js">Chain.js</a></li>
                                <li class=""><a href="ColumnSet.js.html" title="ColumnSet.js">ColumnSet.js</a></li>
                                <li class="selected"><a href="DataTable.js.html" title="DataTable.js">DataTable.js</a></li>
                                <li class=""><a href="EventDelegate.js.html" title="EventDelegate.js">EventDelegate.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2011 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">

    var ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.widget.Column", "name": "abbr", "url": "YAHOO.widget.Column.html#property_abbr", "type": "property"}, {"access": "", "host": "YAHOO.util.Chain", "name": "add", "url": "YAHOO.util.Chain.html#method_add", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "addCellEditor", "url": "YAHOO.widget.DataTable.html#method_addCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "addRow", "url": "YAHOO.widget.DataTable.html#method_addRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "addRows", "url": "YAHOO.widget.DataTable.html#method_addRows", "type": "method"}, {"access": "private", "host": "YAHOO.widget.ColumnSet", "name": "_aDefinitions", "url": "YAHOO.widget.ColumnSet.html#property__aDefinitions", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_aDynFunctions", "url": "YAHOO.widget.DataTable.html#property__aDynFunctions", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_aSelections", "url": "YAHOO.widget.DataTable.html#property__aSelections", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "asyncSubmitter", "url": "YAHOO.widget.BaseCellEditor.html#property_asyncSubmitter", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "attach", "url": "YAHOO.widget.BaseCellEditor.html#method_attach", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeCaptionChange", "url": "YAHOO.widget.DataTable.html#event_beforeCaptionChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeCurrencyOptionsChange", "url": "YAHOO.widget.DataTable.html#event_beforeCurrencyOptionsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeCurrencySymbolChange", "url": "YAHOO.widget.DataTable.html#event_beforeCurrencySymbolChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeDateOptionsChange", "url": "YAHOO.widget.DataTable.html#event_beforeDateOptionsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeDraggableColumnsChange", "url": "YAHOO.widget.DataTable.html#event_beforeDraggableColumnsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeDynamicDataChange", "url": "YAHOO.widget.DataTable.html#event_beforeDynamicDataChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeFormatRowChange", "url": "YAHOO.widget.DataTable.html#event_beforeFormatRowChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeGenerateRequestChange", "url": "YAHOO.widget.DataTable.html#event_beforeGenerateRequestChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeInitialLoadChange", "url": "YAHOO.widget.DataTable.html#event_beforeInitialLoadChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeInitialRequestChange", "url": "YAHOO.widget.DataTable.html#event_beforeInitialRequestChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeMSG_EMPTYChange", "url": "YAHOO.widget.DataTable.html#event_beforeMSG_EMPTYChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeMSG_ERRORChange", "url": "YAHOO.widget.DataTable.html#event_beforeMSG_ERRORChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeMSG_LOADINGChange", "url": "YAHOO.widget.DataTable.html#event_beforeMSG_LOADINGChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeMSG_SORTASCChange", "url": "YAHOO.widget.DataTable.html#event_beforeMSG_SORTASCChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeMSG_SORTDESCChange", "url": "YAHOO.widget.DataTable.html#event_beforeMSG_SORTDESCChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeNumberOptionsChange", "url": "YAHOO.widget.DataTable.html#event_beforeNumberOptionsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforePaginatorChange", "url": "YAHOO.widget.DataTable.html#event_beforePaginatorChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeRenderEvent", "url": "YAHOO.widget.DataTable.html#event_beforeRenderEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeRenderLoopSizeChange", "url": "YAHOO.widget.DataTable.html#event_beforeRenderLoopSizeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeSelectionModeChange", "url": "YAHOO.widget.DataTable.html#event_beforeSelectionModeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeSortedByChange", "url": "YAHOO.widget.DataTable.html#event_beforeSortedByChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeSortFunctionChange", "url": "YAHOO.widget.DataTable.html#event_beforeSortFunctionChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "beforeSummaryChange", "url": "YAHOO.widget.DataTable.html#event_beforeSummaryChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_bInit", "url": "YAHOO.widget.DataTable.html#property__bInit", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "block", "url": "YAHOO.widget.BaseCellEditor.html#method_block", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "blurEvent", "url": "YAHOO.widget.BaseCellEditor.html#event_blurEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "buttonClickEvent", "url": "YAHOO.widget.DataTable.html#event_buttonClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "calendar", "url": "YAHOO.widget.DateCellEditor.html#property_calendar", "type": "property"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "calendarOptions", "url": "YAHOO.widget.DateCellEditor.html#property_calendarOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "cancel", "url": "YAHOO.widget.BaseCellEditor.html#method_cancel", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cancelCellEditor", "url": "YAHOO.widget.DataTable.html#method_cancelCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "cancelEvent", "url": "YAHOO.widget.BaseCellEditor.html#event_cancelEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "caption", "url": "YAHOO.widget.DataTable.html#config_caption", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "captionChange", "url": "YAHOO.widget.DataTable.html#event_captionChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellClickEvent", "url": "YAHOO.widget.DataTable.html#event_cellClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_cellDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "CellEditor.CLASS_CELLEDITOR", "url": "YAHOO.widget.BaseCellEditor.html#property_CellEditor.CLASS_CELLEDITOR", "type": "property"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "CellEditor._nCount", "url": "YAHOO.widget.BaseCellEditor.html#property_CellEditor._nCount", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellFormatEvent", "url": "YAHOO.widget.DataTable.html#event_cellFormatEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellHighlightEvent", "url": "YAHOO.widget.DataTable.html#event_cellHighlightEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_cellMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_cellMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_cellMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellMouseupEvent", "url": "YAHOO.widget.DataTable.html#event_cellMouseupEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellSelectEvent", "url": "YAHOO.widget.DataTable.html#event_cellSelectEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellUnhighlightEvent", "url": "YAHOO.widget.DataTable.html#event_cellUnhighlightEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellUnselectEvent", "url": "YAHOO.widget.DataTable.html#event_cellUnselectEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "cellUpdateEvent", "url": "YAHOO.widget.DataTable.html#event_cellUpdateEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "checkboxClickEvent", "url": "YAHOO.widget.DataTable.html#event_checkboxClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "checkboxes", "url": "YAHOO.widget.CheckboxCellEditor.html#property_checkboxes", "type": "property"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "checkboxOptions", "url": "YAHOO.widget.CheckboxCellEditor.html#property_checkboxOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "children", "url": "YAHOO.widget.Column.html#property_children", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "className", "url": "YAHOO.widget.BaseCellEditor.html#property_className", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "className", "url": "YAHOO.widget.Column.html#property_className", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_clearMinWidth", "url": "YAHOO.widget.DataTable.html#method__clearMinWidth", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "clearTextSelection", "url": "YAHOO.widget.DataTable.html#method_clearTextSelection", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_clearTrTemplateEl", "url": "YAHOO.widget.DataTable.html#method__clearTrTemplateEl", "type": "method"}, {"access": "private", "host": "YAHOO.util.ColumnResizer", "name": "clickValidator", "url": "YAHOO.util.ColumnResizer.html#method_clickValidator", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnHideEvent", "url": "YAHOO.widget.DataTable.html#event_columnHideEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnHighlightEvent", "url": "YAHOO.widget.DataTable.html#event_columnHighlightEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnInsertEvent", "url": "YAHOO.widget.DataTable.html#event_columnInsertEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "Column._nCount", "url": "YAHOO.widget.Column.html#property_Column._nCount", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnRemoveEvent", "url": "YAHOO.widget.DataTable.html#event_columnRemoveEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnReorderEvent", "url": "YAHOO.widget.DataTable.html#event_columnReorderEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnResizeEvent", "url": "YAHOO.widget.DataTable.html#event_columnResizeEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnSelectEvent", "url": "YAHOO.widget.DataTable.html#event_columnSelectEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.ColumnSet", "name": "ColumnSet._nCount", "url": "YAHOO.widget.ColumnSet.html#property_ColumnSet._nCount", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnSetWidthEvent", "url": "YAHOO.widget.DataTable.html#event_columnSetWidthEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnShowEvent", "url": "YAHOO.widget.DataTable.html#event_columnShowEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnSortEvent", "url": "YAHOO.widget.DataTable.html#event_columnSortEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnUnhighlightEvent", "url": "YAHOO.widget.DataTable.html#event_columnUnhighlightEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnUnselectEvent", "url": "YAHOO.widget.DataTable.html#event_columnUnselectEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "columnUnsetWidthEvent", "url": "YAHOO.widget.DataTable.html#event_columnUnsetWidthEvent", "type": "event"}, {"access": "", "host": "YAHOO.util.Sort", "name": "compare", "url": "YAHOO.util.Sort.html#method_compare", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "configs", "url": "YAHOO.widget.DataTable.html#property_configs", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_createTrEl", "url": "YAHOO.widget.DataTable.html#method__createTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "currencyOptions", "url": "YAHOO.widget.Column.html#property_currencyOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "currencyOptions", "url": "YAHOO.widget.DataTable.html#config_currencyOptions", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "currencyOptionsChange", "url": "YAHOO.widget.DataTable.html#event_currencyOptionsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "currencySymbol", "url": "YAHOO.widget.DataTable.html#config_currencySymbol", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "currencySymbolChange", "url": "YAHOO.widget.DataTable.html#event_currencySymbolChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "dataReturnEvent", "url": "YAHOO.widget.DataTable.html#event_dataReturnEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "DataTable._bDynStylesFallback", "url": "YAHOO.widget.DataTable.html#property_DataTable._bDynStylesFallback", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_ASC", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_ASC", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_BUTTON", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_BUTTON", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_CHECKBOX", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_CHECKBOX", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_COLTARGET", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_COLTARGET", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_DATA", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_DATA", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_DATATABLE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_DATATABLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_DEFAULT", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_DEFAULT", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_DESC", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_DESC", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_DISABLED", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_DISABLED", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_DRAGGABLE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_DRAGGABLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_DROPDOWN", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_DROPDOWN", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_EDITABLE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_EDITABLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_EDITOR", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_EDITOR", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_EDITOR_SHIM", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_EDITOR_SHIM", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_EMPTY", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_EMPTY", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_ERROR", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_ERROR", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_EVEN", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_EVEN", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_FIRST", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_FIRST", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_HIDDEN", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_HIDDEN", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_HIGHLIGHTED", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_HIGHLIGHTED", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_LABEL", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_LABEL", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_LAST", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_LAST", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_LINER", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_LINER", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_LOADING", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_LOADING", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_MASK", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_MASK", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_MESSAGE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_MESSAGE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_NEXT", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_NEXT", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_ODD", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_ODD", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_PAGE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_PAGE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_PAGINATOR", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_PAGINATOR", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_PREVIOUS", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_PREVIOUS", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_RADIO", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_RADIO", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_REC", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_REC", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_RESIZEABLE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_RESIZEABLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_RESIZER", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_RESIZER", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_RESIZERLINER", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_RESIZERLINER", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_RESIZERPROXY", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_RESIZERPROXY", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_SCROLLABLE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_SCROLLABLE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_SELECTED", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_SELECTED", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.CLASS_SORTABLE", "url": "YAHOO.widget.DataTable.html#property_DataTable.CLASS_SORTABLE", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "DataTable._cloneObject", "url": "YAHOO.widget.DataTable.html#method_DataTable._cloneObject", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.editCheckbox", "url": "YAHOO.widget.DataTable.html#method_DataTable.editCheckbox", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.editDate", "url": "YAHOO.widget.DataTable.html#method_DataTable.editDate", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.editDropdown", "url": "YAHOO.widget.DataTable.html#method_DataTable.editDropdown", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextboxCellEditor", "name": "DataTable.Editors", "url": "YAHOO.widget.TextboxCellEditor.html#property_DataTable.Editors", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.editRadio", "url": "YAHOO.widget.DataTable.html#method_DataTable.editRadio", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.editTextarea", "url": "YAHOO.widget.DataTable.html#method_DataTable.editTextarea", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.editTextbox", "url": "YAHOO.widget.DataTable.html#method_DataTable.editTextbox", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "DataTable._elDynStyleNode", "url": "YAHOO.widget.DataTable.html#property_DataTable._elDynStyleNode", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatButton", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatButton", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatCheckbox", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatCheckbox", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatCurrency", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatCurrency", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatDate", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatDate", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatDefault", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatDefault", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatDropdown", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatDropdown", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatEmail", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatEmail", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatLink", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatLink", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatNumber", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatNumber", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatRadio", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatRadio", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.Formatter", "url": "YAHOO.widget.DataTable.html#property_DataTable.Formatter", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatText", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatText", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatTextarea", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatTextarea", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.formatTextbox", "url": "YAHOO.widget.DataTable.html#method_DataTable.formatTextbox", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "DataTable._nCount", "url": "YAHOO.widget.DataTable.html#property_DataTable._nCount", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "DataTable._nCurrentCount", "url": "YAHOO.widget.DataTable.html#property_DataTable._nCurrentCount", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "DataTable._oDynStyles", "url": "YAHOO.widget.DataTable.html#property_DataTable._oDynStyles", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "DataTable.validateNumber", "url": "YAHOO.widget.DataTable.html#method_DataTable.validateNumber", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "dateOptions", "url": "YAHOO.widget.Column.html#property_dateOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "dateOptions", "url": "YAHOO.widget.DataTable.html#config_dateOptions", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "dateOptionsChange", "url": "YAHOO.widget.DataTable.html#event_dateOptionsChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_dd", "url": "YAHOO.widget.Column.html#property__dd", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_ddResizer", "url": "YAHOO.widget.Column.html#property__ddResizer", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_defaultPaginatorContainers", "url": "YAHOO.widget.DataTable.html#method__defaultPaginatorContainers", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "defaultValue", "url": "YAHOO.widget.BaseCellEditor.html#property_defaultValue", "type": "property"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "defaultValue", "url": "YAHOO.widget.DateCellEditor.html#property_defaultValue", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "deleteRow", "url": "YAHOO.widget.DataTable.html#method_deleteRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "deleteRows", "url": "YAHOO.widget.DataTable.html#method_deleteRows", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_deleteTrEl", "url": "YAHOO.widget.DataTable.html#method__deleteTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "destroy", "url": "YAHOO.widget.BaseCellEditor.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "destroy", "url": "YAHOO.widget.DataTable.html#method_destroy", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "destroyCellEditor", "url": "YAHOO.widget.DataTable.html#method_destroyCellEditor", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyColgroupEl", "url": "YAHOO.widget.DataTable.html#method__destroyColgroupEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyColumnDragTargetEl", "url": "YAHOO.widget.DataTable.html#method__destroyColumnDragTargetEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyColumnHelpers", "url": "YAHOO.widget.DataTable.html#method__destroyColumnHelpers", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyColumnResizerProxyEl", "url": "YAHOO.widget.DataTable.html#method__destroyColumnResizerProxyEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyContainerEl", "url": "YAHOO.widget.DataTable.html#method__destroyContainerEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyDraggableColumns", "url": "YAHOO.widget.DataTable.html#method__destroyDraggableColumns", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyMsgTbodyEl", "url": "YAHOO.widget.DataTable.html#method__destroyMsgTbodyEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyPaginator", "url": "YAHOO.widget.DataTable.html#method__destroyPaginator", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyResizeableColumns", "url": "YAHOO.widget.DataTable.html#method__destroyResizeableColumns", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyTableEl", "url": "YAHOO.widget.DataTable.html#method__destroyTableEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyTbodyEl", "url": "YAHOO.widget.DataTable.html#method__destroyTbodyEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_destroyTheadEl", "url": "YAHOO.widget.DataTable.html#method__destroyTheadEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "disable", "url": "YAHOO.widget.DataTable.html#method_disable", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "disableBtns", "url": "YAHOO.widget.BaseCellEditor.html#property_disableBtns", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_disabled", "url": "YAHOO.widget.DataTable.html#property__disabled", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "disableEvent", "url": "YAHOO.widget.DataTable.html#event_disableEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "doAfterRender", "url": "YAHOO.widget.BaseCellEditor.html#method_doAfterRender", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "doBeforeLoadData", "url": "YAHOO.widget.DataTable.html#method_doBeforeLoadData", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "doBeforePaginatorChange", "url": "YAHOO.widget.DataTable.html#method_doBeforePaginatorChange", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "doBeforeShowCellEditor", "url": "YAHOO.widget.DataTable.html#method_doBeforeShowCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "doBeforeSortColumn", "url": "YAHOO.widget.DataTable.html#method_doBeforeSortColumn", "type": "method"}, {"access": "", "host": "YAHOO.util.Chain", "name": "Dom", "url": "YAHOO.util.Chain.html#property_Dom", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "draggableColumns", "url": "YAHOO.widget.DataTable.html#config_draggableColumns", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "draggableColumnsChange", "url": "YAHOO.widget.DataTable.html#event_draggableColumnsChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "dropdown", "url": "YAHOO.widget.DropdownCellEditor.html#property_dropdown", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "dropdownChangeEvent", "url": "YAHOO.widget.DataTable.html#event_dropdownChangeEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "dropdownOptions", "url": "YAHOO.widget.DropdownCellEditor.html#property_dropdownOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "dropdownOptions", "url": "YAHOO.widget.Column.html#property_dropdownOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "dynamicData", "url": "YAHOO.widget.DataTable.html#config_dynamicData", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "dynamicDataChange", "url": "YAHOO.widget.DataTable.html#event_dynamicDataChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Column", "name": "editor", "url": "YAHOO.widget.Column.html#property_editor", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorBlockEvent", "url": "YAHOO.widget.DataTable.html#event_editorBlockEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorBlurEvent", "url": "YAHOO.widget.DataTable.html#event_editorBlurEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorCancelEvent", "url": "YAHOO.widget.DataTable.html#event_editorCancelEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorKeydownEvent", "url": "YAHOO.widget.DataTable.html#event_editorKeydownEvent", "type": "event"}, {"access": "", "host": "YAHOO.util.ColumnResizer", "name": "editorOptions", "url": "YAHOO.util.ColumnResizer.html#property_editorOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorRevertEvent", "url": "YAHOO.widget.DataTable.html#event_editorRevertEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorSaveEvent", "url": "YAHOO.widget.DataTable.html#event_editorSaveEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorShowEvent", "url": "YAHOO.widget.DataTable.html#event_editorShowEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorUnblockEvent", "url": "YAHOO.widget.DataTable.html#event_editorUnblockEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "editorUpdateEvent", "url": "YAHOO.widget.DataTable.html#event_editorUpdateEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_elCancelBtn", "url": "YAHOO.widget.BaseCellEditor.html#property__elCancelBtn", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elCaption", "url": "YAHOO.widget.DataTable.html#property__elCaption", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elColgroup", "url": "YAHOO.widget.DataTable.html#property__elColgroup", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elColumnDragTarget", "url": "YAHOO.widget.DataTable.html#property__elColumnDragTarget", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elColumnResizerProxy", "url": "YAHOO.widget.DataTable.html#property__elColumnResizerProxy", "type": "property"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_elContainer", "url": "YAHOO.widget.BaseCellEditor.html#property__elContainer", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elContainer", "url": "YAHOO.widget.DataTable.html#property__elContainer", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elMask", "url": "YAHOO.widget.DataTable.html#property__elMask", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elMsgTbody", "url": "YAHOO.widget.DataTable.html#property__elMsgTbody", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elMsgTd", "url": "YAHOO.widget.DataTable.html#property__elMsgTd", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elMsgTr", "url": "YAHOO.widget.DataTable.html#property__elMsgTr", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_elResizer", "url": "YAHOO.widget.Column.html#property__elResizer", "type": "property"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_elSaveBtn", "url": "YAHOO.widget.BaseCellEditor.html#property__elSaveBtn", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elTable", "url": "YAHOO.widget.DataTable.html#property__elTable", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elTbody", "url": "YAHOO.widget.DataTable.html#property__elTbody", "type": "property"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_elTd", "url": "YAHOO.widget.BaseCellEditor.html#property__elTd", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_elTh", "url": "YAHOO.widget.Column.html#property__elTh", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elThead", "url": "YAHOO.widget.DataTable.html#property__elThead", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_elThLabel", "url": "YAHOO.widget.Column.html#property__elThLabel", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_elThLiner", "url": "YAHOO.widget.Column.html#property__elThLiner", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_elTrTemplate", "url": "YAHOO.widget.DataTable.html#property__elTrTemplate", "type": "property"}, {"access": "", "host": "YAHOO.util.Chain", "name": "end", "url": "YAHOO.util.Chain.html#event_end", "type": "event"}, {"access": "", "host": "YAHOO.widget.Column", "name": "field", "url": "YAHOO.widget.Column.html#property_field", "type": "property"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "flat", "url": "YAHOO.widget.ColumnSet.html#property_flat", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "focus", "url": "YAHOO.widget.BaseCellEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "focus", "url": "YAHOO.widget.CheckboxCellEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "focus", "url": "YAHOO.widget.DateCellEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "focus", "url": "YAHOO.widget.DropdownCellEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.RadioCellEditor", "name": "focus", "url": "YAHOO.widget.RadioCellEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextareaCellEditor", "name": "focus", "url": "YAHOO.widget.TextareaCellEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextboxCellEditor", "name": "focus", "url": "YAHOO.widget.TextboxCellEditor.html#method_focus", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "focus", "url": "YAHOO.widget.DataTable.html#method_focus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_focusEl", "url": "YAHOO.widget.DataTable.html#method__focusEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "focusTbodyEl", "url": "YAHOO.widget.DataTable.html#method_focusTbodyEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "focusTheadEl", "url": "YAHOO.widget.DataTable.html#method_focusTheadEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "formatCell", "url": "YAHOO.widget.DataTable.html#method_formatCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "formatRow", "url": "YAHOO.widget.DataTable.html#config_formatRow", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "formatRowChange", "url": "YAHOO.widget.DataTable.html#event_formatRowChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_formatTdEl", "url": "YAHOO.widget.DataTable.html#method__formatTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "formatter", "url": "YAHOO.widget.Column.html#property_formatter", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "formatTheadCell", "url": "YAHOO.widget.DataTable.html#method_formatTheadCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "generateRequest", "url": "YAHOO.widget.DataTable.html#config_generateRequest", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "generateRequestChange", "url": "YAHOO.widget.DataTable.html#event_generateRequestChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getAboveTdEl", "url": "YAHOO.widget.DataTable.html#method_getAboveTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getBelowTdEl", "url": "YAHOO.widget.DataTable.html#method_getBelowTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getBody", "url": "YAHOO.widget.DataTable.html#method_getBody", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getCell", "url": "YAHOO.widget.DataTable.html#method_getCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getCellEditor", "url": "YAHOO.widget.DataTable.html#method_getCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getCellIndex", "url": "YAHOO.widget.DataTable.html#method_getCellIndex", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getColEl", "url": "YAHOO.widget.Column.html#method_getColEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getColspan", "url": "YAHOO.widget.Column.html#method_getColspan", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "getColumn", "url": "YAHOO.widget.BaseCellEditor.html#method_getColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "getColumn", "url": "YAHOO.widget.ColumnSet.html#method_getColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getColumn", "url": "YAHOO.widget.DataTable.html#method_getColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "getColumnById", "url": "YAHOO.widget.ColumnSet.html#method_getColumnById", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getColumnById", "url": "YAHOO.widget.DataTable.html#method_getColumnById", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_getColumnClassnames", "url": "YAHOO.widget.DataTable.html#method__getColumnClassnames", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getColumnSet", "url": "YAHOO.widget.DataTable.html#method_getColumnSet", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getColumnSortDir", "url": "YAHOO.widget.DataTable.html#method_getColumnSortDir", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "getContainerEl", "url": "YAHOO.widget.BaseCellEditor.html#method_getContainerEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getContainerEl", "url": "YAHOO.widget.DataTable.html#method_getContainerEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getDataSource", "url": "YAHOO.widget.DataTable.html#method_getDataSource", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "getDataTable", "url": "YAHOO.widget.BaseCellEditor.html#method_getDataTable", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getDefinition", "url": "YAHOO.widget.Column.html#method_getDefinition", "type": "method"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "getDefinitions", "url": "YAHOO.widget.ColumnSet.html#method_getDefinitions", "type": "method"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "getDescendants", "url": "YAHOO.widget.ColumnSet.html#method_getDescendants", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getField", "url": "YAHOO.widget.Column.html#method_getField", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getFirstTdEl", "url": "YAHOO.widget.DataTable.html#method_getFirstTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getFirstTrEl", "url": "YAHOO.widget.DataTable.html#method_getFirstTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "getId", "url": "YAHOO.widget.BaseCellEditor.html#method_getId", "type": "method"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "getId", "url": "YAHOO.widget.ColumnSet.html#method_getId", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getId", "url": "YAHOO.widget.Column.html#method_getId", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getId", "url": "YAHOO.widget.DataTable.html#method_getId", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "getInputValue", "url": "YAHOO.widget.BaseCellEditor.html#method_getInputValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "getInputValue", "url": "YAHOO.widget.CheckboxCellEditor.html#method_getInputValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "getInputValue", "url": "YAHOO.widget.DateCellEditor.html#method_getInputValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "getInputValue", "url": "YAHOO.widget.DropdownCellEditor.html#method_getInputValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.RadioCellEditor", "name": "getInputValue", "url": "YAHOO.widget.RadioCellEditor.html#method_getInputValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextareaCellEditor", "name": "getInputValue", "url": "YAHOO.widget.TextareaCellEditor.html#method_getInputValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextboxCellEditor", "name": "getInputValue", "url": "YAHOO.widget.TextboxCellEditor.html#method_getInputValue", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getKey", "url": "YAHOO.widget.Column.html#method_getKey", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getKeyIndex", "url": "YAHOO.widget.Column.html#method_getKeyIndex", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getLastSelectedCell", "url": "YAHOO.widget.DataTable.html#method_getLastSelectedCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getLastSelectedRecord", "url": "YAHOO.widget.DataTable.html#method_getLastSelectedRecord", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getLastTdEl", "url": "YAHOO.widget.DataTable.html#method_getLastTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getLastTrEl", "url": "YAHOO.widget.DataTable.html#method_getLastTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getMsgTbodyEl", "url": "YAHOO.widget.DataTable.html#method_getMsgTbodyEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getMsgTdEl", "url": "YAHOO.widget.DataTable.html#method_getMsgTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getNextTdEl", "url": "YAHOO.widget.DataTable.html#method_getNextTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getNextTrEl", "url": "YAHOO.widget.DataTable.html#method_getNextTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getParent", "url": "YAHOO.widget.Column.html#method_getParent", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getPreviousTdEl", "url": "YAHOO.widget.DataTable.html#method_getPreviousTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getPreviousTrEl", "url": "YAHOO.widget.DataTable.html#method_getPreviousTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "getRecord", "url": "YAHOO.widget.BaseCellEditor.html#method_getRecord", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getRecord", "url": "YAHOO.widget.DataTable.html#method_getRecord", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getRecordIndex", "url": "YAHOO.widget.DataTable.html#method_getRecordIndex", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getRecordSet", "url": "YAHOO.widget.DataTable.html#method_getRecordSet", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getResizerEl", "url": "YAHOO.widget.Column.html#method_getResizerEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getRow", "url": "YAHOO.widget.DataTable.html#method_getRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getRowspan", "url": "YAHOO.widget.Column.html#method_getRowspan", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getSanitizedKey", "url": "YAHOO.widget.Column.html#method_getSanitizedKey", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getSelectedCells", "url": "YAHOO.widget.DataTable.html#method_getSelectedCells", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getSelectedColumns", "url": "YAHOO.widget.DataTable.html#method_getSelectedColumns", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getSelectedRows", "url": "YAHOO.widget.DataTable.html#method_getSelectedRows", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getSelectedTdEls", "url": "YAHOO.widget.DataTable.html#method_getSelectedTdEls", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getSelectedTrEls", "url": "YAHOO.widget.DataTable.html#method_getSelectedTrEls", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_getSelectionAnchor", "url": "YAHOO.widget.DataTable.html#method__getSelectionAnchor", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_getSelectionTrigger", "url": "YAHOO.widget.DataTable.html#method__getSelectionTrigger", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getState", "url": "YAHOO.widget.DataTable.html#method_getState", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getTableEl", "url": "YAHOO.widget.DataTable.html#method_getTableEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getTbodyEl", "url": "YAHOO.widget.DataTable.html#method_getTbodyEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "getTdEl", "url": "YAHOO.widget.BaseCellEditor.html#method_getTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getTdEl", "url": "YAHOO.widget.DataTable.html#method_getTdEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getTdLinerEl", "url": "YAHOO.widget.DataTable.html#method_getTdLinerEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getTheadEl", "url": "YAHOO.widget.DataTable.html#method_getTheadEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getThEl", "url": "YAHOO.widget.Column.html#method_getThEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getThEl", "url": "YAHOO.widget.DataTable.html#method_getThEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getThLInerEl", "url": "YAHOO.widget.Column.html#method_getThLInerEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getThLinerEl", "url": "YAHOO.widget.DataTable.html#method_getThLinerEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "getTreeIndex", "url": "YAHOO.widget.Column.html#method_getTreeIndex", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getTrEl", "url": "YAHOO.widget.DataTable.html#method_getTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "getTrIndex", "url": "YAHOO.widget.DataTable.html#method_getTrIndex", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_getTrTemplateEl", "url": "YAHOO.widget.DataTable.html#method__getTrTemplateEl", "type": "method"}, {"access": "protected", "host": "YAHOO.widget.DataTable", "name": "_getViewRecords", "url": "YAHOO.widget.DataTable.html#method__getViewRecords", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleCellBlockSelectionByKey", "url": "YAHOO.widget.DataTable.html#method__handleCellBlockSelectionByKey", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleCellBlockSelectionByMouse", "url": "YAHOO.widget.DataTable.html#method__handleCellBlockSelectionByMouse", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleCellRangeSelectionByKey", "url": "YAHOO.widget.DataTable.html#method__handleCellRangeSelectionByKey", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleCellRangeSelectionByMouse", "url": "YAHOO.widget.DataTable.html#method__handleCellRangeSelectionByMouse", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleDataReturnPayload", "url": "YAHOO.widget.DataTable.html#method__handleDataReturnPayload", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "handleDataReturnPayload", "url": "YAHOO.widget.DataTable.html#method_handleDataReturnPayload", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "handleDisabledBtns", "url": "YAHOO.widget.BaseCellEditor.html#method_handleDisabledBtns", "type": "method"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "handleDisabledBtns", "url": "YAHOO.widget.CheckboxCellEditor.html#method_handleDisabledBtns", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "handleDisabledBtns", "url": "YAHOO.widget.DateCellEditor.html#method_handleDisabledBtns", "type": "method"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "handleDisabledBtns", "url": "YAHOO.widget.DropdownCellEditor.html#method_handleDisabledBtns", "type": "method"}, {"access": "", "host": "YAHOO.widget.RadioCellEditor", "name": "handleDisabledBtns", "url": "YAHOO.widget.RadioCellEditor.html#method_handleDisabledBtns", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextareaCellEditor", "name": "handleDisabledBtns", "url": "YAHOO.widget.TextareaCellEditor.html#method_handleDisabledBtns", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handlePaginatorChange", "url": "YAHOO.widget.DataTable.html#method__handlePaginatorChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleSingleCellSelectionByKey", "url": "YAHOO.widget.DataTable.html#method__handleSingleCellSelectionByKey", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleSingleCellSelectionByMouse", "url": "YAHOO.widget.DataTable.html#method__handleSingleCellSelectionByMouse", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleSingleSelectionByKey", "url": "YAHOO.widget.DataTable.html#method__handleSingleSelectionByKey", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleSingleSelectionByMouse", "url": "YAHOO.widget.DataTable.html#method__handleSingleSelectionByMouse", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleStandardSelectionByKey", "url": "YAHOO.widget.DataTable.html#method__handleStandardSelectionByKey", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_handleStandardSelectionByMouse", "url": "YAHOO.widget.DataTable.html#method__handleStandardSelectionByMouse", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerCellClickEvent", "url": "YAHOO.widget.DataTable.html#event_headerCellClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerCellDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_headerCellDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerCellMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_headerCellMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerCellMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_headerCellMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerCellMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_headerCellMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerLabelClickEvent", "url": "YAHOO.widget.DataTable.html#event_headerLabelClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerLabelDbllickEvent", "url": "YAHOO.widget.DataTable.html#event_headerLabelDbllickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerLabelMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_headerLabelMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerLabelMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_headerLabelMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerLabelMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_headerLabelMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerRowClickEvent", "url": "YAHOO.widget.DataTable.html#event_headerRowClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerRowDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_headerRowDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerRowMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_headerRowMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerRowMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_headerRowMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "headerRowMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_headerRowMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "headers", "url": "YAHOO.widget.ColumnSet.html#property_headers", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "hidden", "url": "YAHOO.widget.Column.html#property_hidden", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "_hide", "url": "YAHOO.widget.BaseCellEditor.html#method__hide", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "hideColumn", "url": "YAHOO.widget.DataTable.html#method_hideColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "hideTableMessage", "url": "YAHOO.widget.DataTable.html#method_hideTableMessage", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "highlightCell", "url": "YAHOO.widget.DataTable.html#method_highlightCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "highlightColumn", "url": "YAHOO.widget.DataTable.html#method_highlightColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "highlightRow", "url": "YAHOO.widget.DataTable.html#method_highlightRow", "type": "method"}, {"access": "private", "host": "YAHOO.util.Chain", "name": "id", "url": "YAHOO.util.Chain.html#property_id", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ColumnSet", "name": "_init", "url": "YAHOO.widget.ColumnSet.html#method__init", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "initAttributes", "url": "YAHOO.widget.DataTable.html#method_initAttributes", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initCaptionEl", "url": "YAHOO.widget.DataTable.html#method__initCaptionEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initCellEditing", "url": "YAHOO.widget.DataTable.html#method__initCellEditing", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initCellEditorEl", "url": "YAHOO.widget.DataTable.html#method__initCellEditorEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initColgroupEl", "url": "YAHOO.widget.DataTable.html#method__initColgroupEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initColumnDragTargetEl", "url": "YAHOO.widget.DataTable.html#method__initColumnDragTargetEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initColumnHelpers", "url": "YAHOO.widget.DataTable.html#method__initColumnHelpers", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initColumnResizerProxyEl", "url": "YAHOO.widget.DataTable.html#method__initColumnResizerProxyEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initColumnSet", "url": "YAHOO.widget.DataTable.html#method__initColumnSet", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initColumnSort", "url": "YAHOO.widget.DataTable.html#method__initColumnSort", "type": "method"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_initConfigs", "url": "YAHOO.widget.BaseCellEditor.html#method__initConfigs", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initConfigs", "url": "YAHOO.widget.DataTable.html#method__initConfigs", "type": "method"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_initContainerEl", "url": "YAHOO.widget.BaseCellEditor.html#method__initContainerEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initContainerEl", "url": "YAHOO.widget.DataTable.html#method__initContainerEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initDataSource", "url": "YAHOO.widget.DataTable.html#method__initDataSource", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initDomElements", "url": "YAHOO.widget.DataTable.html#method__initDomElements", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initDraggableColumns", "url": "YAHOO.widget.DataTable.html#method__initDraggableColumns", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "initEvent", "url": "YAHOO.widget.DataTable.html#event_initEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_initEvents", "url": "YAHOO.widget.BaseCellEditor.html#method__initEvents", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initEvents", "url": "YAHOO.widget.DataTable.html#method__initEvents", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "initializeTable", "url": "YAHOO.widget.DataTable.html#method_initializeTable", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "initialLoad", "url": "YAHOO.widget.DataTable.html#config_initialLoad", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "initialLoadChange", "url": "YAHOO.widget.DataTable.html#event_initialLoadChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "initialRequest", "url": "YAHOO.widget.DataTable.html#config_initialRequest", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "initialRequestChange", "url": "YAHOO.widget.DataTable.html#event_initialRequestChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initMsgTbodyEl", "url": "YAHOO.widget.DataTable.html#method__initMsgTbodyEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initRecordSet", "url": "YAHOO.widget.DataTable.html#method__initRecordSet", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initResizeableColumns", "url": "YAHOO.widget.DataTable.html#method__initResizeableColumns", "type": "method"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_initShimEl", "url": "YAHOO.widget.BaseCellEditor.html#method__initShimEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initTableEl", "url": "YAHOO.widget.DataTable.html#method__initTableEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initTbodyEl", "url": "YAHOO.widget.DataTable.html#method__initTbodyEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initTheadEl", "url": "YAHOO.widget.DataTable.html#method__initTheadEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_initThEl", "url": "YAHOO.widget.DataTable.html#method__initThEl", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_insertColgroupColEl", "url": "YAHOO.widget.DataTable.html#method__insertColgroupColEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "insertColumn", "url": "YAHOO.widget.DataTable.html#method_insertColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "invalidDataEvent", "url": "YAHOO.widget.BaseCellEditor.html#event_invalidDataEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "isActive", "url": "YAHOO.widget.BaseCellEditor.html#property_isActive", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "isDisabled", "url": "YAHOO.widget.DataTable.html#method_isDisabled", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "isSelected", "url": "YAHOO.widget.DataTable.html#method_isSelected", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "key", "url": "YAHOO.widget.Column.html#property_key", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "keydownEvent", "url": "YAHOO.widget.BaseCellEditor.html#event_keydownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "keys", "url": "YAHOO.widget.ColumnSet.html#property_keys", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "label", "url": "YAHOO.widget.Column.html#property_label", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "LABEL_CANCEL", "url": "YAHOO.widget.BaseCellEditor.html#property_LABEL_CANCEL", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "LABEL_SAVE", "url": "YAHOO.widget.BaseCellEditor.html#property_LABEL_SAVE", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "linkClickEvent", "url": "YAHOO.widget.DataTable.html#event_linkClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "load", "url": "YAHOO.widget.DataTable.html#method_load", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "maxAutoWidth", "url": "YAHOO.widget.Column.html#property_maxAutoWidth", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "minWidth", "url": "YAHOO.widget.Column.html#property_minWidth", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "move", "url": "YAHOO.widget.BaseCellEditor.html#method_move", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextareaCellEditor", "name": "move", "url": "YAHOO.widget.TextareaCellEditor.html#method_move", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextboxCellEditor", "name": "move", "url": "YAHOO.widget.TextboxCellEditor.html#method_move", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_EMPTY", "url": "YAHOO.widget.DataTable.html#config_MSG_EMPTY", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_EMPTYChange", "url": "YAHOO.widget.DataTable.html#event_MSG_EMPTYChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_ERROR", "url": "YAHOO.widget.DataTable.html#config_MSG_ERROR", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_ERRORChange", "url": "YAHOO.widget.DataTable.html#event_MSG_ERRORChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_LOADING", "url": "YAHOO.widget.DataTable.html#config_MSG_LOADING", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_LOADINGChange", "url": "YAHOO.widget.DataTable.html#event_MSG_LOADINGChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_SORTASC", "url": "YAHOO.widget.DataTable.html#config_MSG_SORTASC", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_SORTASCChange", "url": "YAHOO.widget.DataTable.html#event_MSG_SORTASCChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_SORTDESC", "url": "YAHOO.widget.DataTable.html#config_MSG_SORTDESC", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "MSG_SORTDESCChange", "url": "YAHOO.widget.DataTable.html#event_MSG_SORTDESCChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "multiple", "url": "YAHOO.widget.DropdownCellEditor.html#property_multiple", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_nColspan", "url": "YAHOO.widget.Column.html#property__nColspan", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_nIndex", "url": "YAHOO.widget.DataTable.html#property__nIndex", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_nKeyIndex", "url": "YAHOO.widget.Column.html#property__nKeyIndex", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_nRowspan", "url": "YAHOO.widget.Column.html#property__nRowspan", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_nTdCount", "url": "YAHOO.widget.DataTable.html#property__nTdCount", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_nTrCount", "url": "YAHOO.widget.DataTable.html#property__nTrCount", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_nTreeIndex", "url": "YAHOO.widget.Column.html#property__nTreeIndex", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "numberOptions", "url": "YAHOO.widget.DataTable.html#config_numberOptions", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "numberOptionsChange", "url": "YAHOO.widget.DataTable.html#event_numberOptionsChange", "type": "event"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_nWidth", "url": "YAHOO.widget.Column.html#property__nWidth", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_oAnchorCell", "url": "YAHOO.widget.DataTable.html#property__oAnchorCell", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_oAnchorRecord", "url": "YAHOO.widget.DataTable.html#property__oAnchorRecord", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_oCellEditor", "url": "YAHOO.widget.DataTable.html#property__oCellEditor", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_oChainRender", "url": "YAHOO.widget.DataTable.html#property__oChainRender", "type": "property"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_oColumn", "url": "YAHOO.widget.BaseCellEditor.html#property__oColumn", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_oColumnSet", "url": "YAHOO.widget.DataTable.html#property__oColumnSet", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_oDataSource", "url": "YAHOO.widget.DataTable.html#property__oDataSource", "type": "property"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_oDataTable", "url": "YAHOO.widget.BaseCellEditor.html#property__oDataTable", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onDataReturnAppendRows", "url": "YAHOO.widget.DataTable.html#method_onDataReturnAppendRows", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onDataReturnInitializeTable", "url": "YAHOO.widget.DataTable.html#method_onDataReturnInitializeTable", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onDataReturnInsertRows", "url": "YAHOO.widget.DataTable.html#method_onDataReturnInsertRows", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onDataReturnReplaceRows", "url": "YAHOO.widget.DataTable.html#method_onDataReturnReplaceRows", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onDataReturnSetRecords", "url": "YAHOO.widget.DataTable.html#method_onDataReturnSetRecords", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onDataReturnSetRows", "url": "YAHOO.widget.DataTable.html#method_onDataReturnSetRows", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onDataReturnUpdateRows", "url": "YAHOO.widget.DataTable.html#method_onDataReturnUpdateRows", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onDocumentClick", "url": "YAHOO.widget.DataTable.html#method__onDocumentClick", "type": "method"}, {"access": "", "host": "YAHOO.util.ColumnResizer", "name": "onDrag", "url": "YAHOO.util.ColumnResizer.html#method_onDrag", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onDropdownChange", "url": "YAHOO.widget.DataTable.html#method__onDropdownChange", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorBlockEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorBlockEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEditorBlockEvent", "url": "YAHOO.widget.DataTable.html#method_onEditorBlockEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorBlurEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorBlurEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEditorBlurEvent", "url": "YAHOO.widget.DataTable.html#method_onEditorBlurEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorCancelEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorCancelEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorKeydownEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorKeydownEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorRevertEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorRevertEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorSaveEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorSaveEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorShowEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorShowEvent", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onEditorUnblockEvent", "url": "YAHOO.widget.DataTable.html#method__onEditorUnblockEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEditorUnblockEvent", "url": "YAHOO.widget.DataTable.html#method_onEditorUnblockEvent", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventCancelCellEditor", "url": "YAHOO.widget.DataTable.html#method_onEventCancelCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventEditCell", "url": "YAHOO.widget.DataTable.html#method_onEventEditCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventFormatCell", "url": "YAHOO.widget.DataTable.html#method_onEventFormatCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventHighlightCell", "url": "YAHOO.widget.DataTable.html#method_onEventHighlightCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventHighlightColumn", "url": "YAHOO.widget.DataTable.html#method_onEventHighlightColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventHighlightRow", "url": "YAHOO.widget.DataTable.html#method_onEventHighlightRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventSaveCellEditor", "url": "YAHOO.widget.DataTable.html#method_onEventSaveCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventSelectCell", "url": "YAHOO.widget.DataTable.html#method_onEventSelectCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventSelectColumn", "url": "YAHOO.widget.DataTable.html#method_onEventSelectColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventSelectRow", "url": "YAHOO.widget.DataTable.html#method_onEventSelectRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventShowCellEditor", "url": "YAHOO.widget.DataTable.html#method_onEventShowCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventSortColumn", "url": "YAHOO.widget.DataTable.html#method_onEventSortColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventUnhighlightCell", "url": "YAHOO.widget.DataTable.html#method_onEventUnhighlightCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventUnhighlightColumn", "url": "YAHOO.widget.DataTable.html#method_onEventUnhighlightColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onEventUnhighlightRow", "url": "YAHOO.widget.DataTable.html#method_onEventUnhighlightRow", "type": "method"}, {"access": "", "host": "YAHOO.util.ColumnResizer", "name": "onMouseDown", "url": "YAHOO.util.ColumnResizer.html#method_onMouseDown", "type": "method"}, {"access": "", "host": "YAHOO.util.ColumnResizer", "name": "onMouseUp", "url": "YAHOO.util.ColumnResizer.html#method_onMouseUp", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onPaginatorChange", "url": "YAHOO.widget.DataTable.html#method_onPaginatorChange", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onPaginatorChangeRequest", "url": "YAHOO.widget.DataTable.html#method_onPaginatorChangeRequest", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onRenderChainEnd", "url": "YAHOO.widget.DataTable.html#method__onRenderChainEnd", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "onShow", "url": "YAHOO.widget.DataTable.html#method_onShow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTableDblclick", "url": "YAHOO.widget.DataTable.html#method__onTableDblclick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTableFocus", "url": "YAHOO.widget.DataTable.html#method__onTableFocus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTableMousedown", "url": "YAHOO.widget.DataTable.html#method__onTableMousedown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTableMouseout", "url": "YAHOO.widget.DataTable.html#method__onTableMouseout", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTableMouseover", "url": "YAHOO.widget.DataTable.html#method__onTableMouseover", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTableMouseup", "url": "YAHOO.widget.DataTable.html#method__onTableMouseup", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTbodyClick", "url": "YAHOO.widget.DataTable.html#method__onTbodyClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTbodyFocus", "url": "YAHOO.widget.DataTable.html#method__onTbodyFocus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTbodyKeydown", "url": "YAHOO.widget.DataTable.html#method__onTbodyKeydown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTheadClick", "url": "YAHOO.widget.DataTable.html#method__onTheadClick", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTheadFocus", "url": "YAHOO.widget.DataTable.html#method__onTheadFocus", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_onTheadKeydown", "url": "YAHOO.widget.DataTable.html#method__onTheadKeydown", "type": "method"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_oParent", "url": "YAHOO.widget.Column.html#property__oParent", "type": "property"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_oRecord", "url": "YAHOO.widget.BaseCellEditor.html#property__oRecord", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_oRecordSet", "url": "YAHOO.widget.DataTable.html#property__oRecordSet", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "paginator", "url": "YAHOO.widget.DataTable.html#config_paginator", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "paginatorChange", "url": "YAHOO.widget.DataTable.html#event_paginatorChange", "type": "event"}, {"access": "", "host": "YAHOO.util.Chain", "name": "pause", "url": "YAHOO.util.Chain.html#method_pause", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "postRenderEvent", "url": "YAHOO.widget.DataTable.html#event_postRenderEvent", "type": "event"}, {"access": "private", "host": "YAHOO.util.Chain", "name": "q", "url": "YAHOO.util.Chain.html#property_q", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "radioClickEvent", "url": "YAHOO.widget.DataTable.html#event_radioClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.RadioCellEditor", "name": "radioOptions", "url": "YAHOO.widget.RadioCellEditor.html#property_radioOptions", "type": "property"}, {"access": "", "host": "YAHOO.widget.RadioCellEditor", "name": "radios", "url": "YAHOO.widget.RadioCellEditor.html#property_radios", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "refreshView", "url": "YAHOO.widget.DataTable.html#method_refreshView", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_removeColgroupColEl", "url": "YAHOO.widget.DataTable.html#method__removeColgroupColEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "removeColumn", "url": "YAHOO.widget.DataTable.html#method_removeColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "render", "url": "YAHOO.widget.BaseCellEditor.html#method_render", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "render", "url": "YAHOO.widget.DataTable.html#method_render", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "renderBtns", "url": "YAHOO.widget.BaseCellEditor.html#method_renderBtns", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "renderEvent", "url": "YAHOO.widget.DataTable.html#event_renderEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "renderForm", "url": "YAHOO.widget.BaseCellEditor.html#method_renderForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "renderForm", "url": "YAHOO.widget.CheckboxCellEditor.html#method_renderForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "renderForm", "url": "YAHOO.widget.DateCellEditor.html#method_renderForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "renderForm", "url": "YAHOO.widget.DropdownCellEditor.html#method_renderForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.RadioCellEditor", "name": "renderForm", "url": "YAHOO.widget.RadioCellEditor.html#method_renderForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextareaCellEditor", "name": "renderForm", "url": "YAHOO.widget.TextareaCellEditor.html#method_renderForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextboxCellEditor", "name": "renderForm", "url": "YAHOO.widget.TextboxCellEditor.html#method_renderForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "renderLoopSize", "url": "YAHOO.widget.DataTable.html#config_renderLoopSize", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "renderLoopSizeChange", "url": "YAHOO.widget.DataTable.html#event_renderLoopSizeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "renderPaginator", "url": "YAHOO.widget.DataTable.html#method_renderPaginator", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_reorderColgroupColEl", "url": "YAHOO.widget.DataTable.html#method__reorderColgroupColEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "reorderColumn", "url": "YAHOO.widget.DataTable.html#method_reorderColumn", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_repaintGecko", "url": "YAHOO.widget.DataTable.html#method__repaintGecko", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_repaintOpera", "url": "YAHOO.widget.DataTable.html#method__repaintOpera", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_repaintWebkit", "url": "YAHOO.widget.DataTable.html#method__repaintWebkit", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "resetCellEditor", "url": "YAHOO.widget.DataTable.html#method_resetCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "resetForm", "url": "YAHOO.widget.BaseCellEditor.html#method_resetForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "resetForm", "url": "YAHOO.widget.CheckboxCellEditor.html#method_resetForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.DateCellEditor", "name": "resetForm", "url": "YAHOO.widget.DateCellEditor.html#method_resetForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "resetForm", "url": "YAHOO.widget.DropdownCellEditor.html#method_resetForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.RadioCellEditor", "name": "resetForm", "url": "YAHOO.widget.RadioCellEditor.html#method_resetForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextareaCellEditor", "name": "resetForm", "url": "YAHOO.widget.TextareaCellEditor.html#method_resetForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.TextboxCellEditor", "name": "resetForm", "url": "YAHOO.widget.TextboxCellEditor.html#method_resetForm", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "resetInvalidData", "url": "YAHOO.widget.BaseCellEditor.html#property_resetInvalidData", "type": "property"}, {"access": "", "host": "YAHOO.util.ColumnResizer", "name": "resetResizerEl", "url": "YAHOO.util.ColumnResizer.html#method_resetResizerEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "resizeable", "url": "YAHOO.widget.Column.html#property_resizeable", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_restoreMinWidth", "url": "YAHOO.widget.DataTable.html#method__restoreMinWidth", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "revertEvent", "url": "YAHOO.widget.BaseCellEditor.html#event_revertEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowAddEvent", "url": "YAHOO.widget.DataTable.html#event_rowAddEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowClickEvent", "url": "YAHOO.widget.DataTable.html#event_rowClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_rowDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowDeleteEvent", "url": "YAHOO.widget.DataTable.html#event_rowDeleteEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowHighlightEvent", "url": "YAHOO.widget.DataTable.html#event_rowHighlightEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_rowMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_rowMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_rowMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowMouseupEvent", "url": "YAHOO.widget.DataTable.html#event_rowMouseupEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowsAddEvent", "url": "YAHOO.widget.DataTable.html#event_rowsAddEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowsDeleteEvent", "url": "YAHOO.widget.DataTable.html#event_rowsDeleteEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowSelectEvent", "url": "YAHOO.widget.DataTable.html#event_rowSelectEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowUnhighlightEvent", "url": "YAHOO.widget.DataTable.html#event_rowUnhighlightEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowUnselectEvent", "url": "YAHOO.widget.DataTable.html#event_rowUnselectEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "rowUpdateEvent", "url": "YAHOO.widget.DataTable.html#event_rowUpdateEvent", "type": "event"}, {"access": "", "host": "YAHOO.util.Chain", "name": "run", "url": "YAHOO.util.Chain.html#method_run", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_runRenderChain", "url": "YAHOO.widget.DataTable.html#method__runRenderChain", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "save", "url": "YAHOO.widget.BaseCellEditor.html#method_save", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "saveCellEditor", "url": "YAHOO.widget.DataTable.html#method_saveCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "saveEvent", "url": "YAHOO.widget.BaseCellEditor.html#event_saveEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "select", "url": "YAHOO.widget.DataTable.html#method_select", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "selectCell", "url": "YAHOO.widget.DataTable.html#method_selectCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "selectColumn", "url": "YAHOO.widget.DataTable.html#method_selectColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "selected", "url": "YAHOO.widget.Column.html#property_selected", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "selectionMode", "url": "YAHOO.widget.DataTable.html#config_selectionMode", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "selectionModeChange", "url": "YAHOO.widget.DataTable.html#event_selectionModeChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "selectRow", "url": "YAHOO.widget.DataTable.html#method_selectRow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_setColumnWidth", "url": "YAHOO.widget.DataTable.html#method__setColumnWidth", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "setColumnWidth", "url": "YAHOO.widget.DataTable.html#method_setColumnWidth", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_setColumnWidthDynFunction", "url": "YAHOO.widget.DataTable.html#method__setColumnWidthDynFunction", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_setColumnWidthDynStyles", "url": "YAHOO.widget.DataTable.html#method__setColumnWidthDynStyles", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_setFirstRow", "url": "YAHOO.widget.DataTable.html#method__setFirstRow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_setLastRow", "url": "YAHOO.widget.DataTable.html#method__setLastRow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_setRowStripes", "url": "YAHOO.widget.DataTable.html#method__setRowStripes", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_setSelections", "url": "YAHOO.widget.DataTable.html#method__setSelections", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_sFirstTrId", "url": "YAHOO.widget.DataTable.html#property__sFirstTrId", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "show", "url": "YAHOO.widget.BaseCellEditor.html#method_show", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "showCellEditor", "url": "YAHOO.widget.DataTable.html#method_showCellEditor", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "showColumn", "url": "YAHOO.widget.DataTable.html#method_showColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "showEvent", "url": "YAHOO.widget.BaseCellEditor.html#event_showEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "showTableMessage", "url": "YAHOO.widget.DataTable.html#method_showTableMessage", "type": "method"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_sId", "url": "YAHOO.widget.BaseCellEditor.html#property__sId", "type": "property"}, {"access": "private", "host": "YAHOO.widget.ColumnSet", "name": "_sId", "url": "YAHOO.widget.ColumnSet.html#property__sId", "type": "property"}, {"access": "private", "host": "YAHOO.widget.Column", "name": "_sId", "url": "YAHOO.widget.Column.html#property__sId", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_sId", "url": "YAHOO.widget.DataTable.html#property__sId", "type": "property"}, {"access": "", "host": "YAHOO.widget.DropdownCellEditor", "name": "size", "url": "YAHOO.widget.DropdownCellEditor.html#property_size", "type": "property"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_sLastTrId", "url": "YAHOO.widget.DataTable.html#property__sLastTrId", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "sortable", "url": "YAHOO.widget.Column.html#property_sortable", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "sortColumn", "url": "YAHOO.widget.DataTable.html#method_sortColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "sortedBy", "url": "YAHOO.widget.DataTable.html#config_sortedBy", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "sortedByChange", "url": "YAHOO.widget.DataTable.html#event_sortedByChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "sortFunction", "url": "YAHOO.widget.DataTable.html#config_sortFunction", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "sortFunctionChange", "url": "YAHOO.widget.DataTable.html#event_sortFunctionChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.Column", "name": "sortOptions.defaultDir", "url": "YAHOO.widget.Column.html#property_sortOptions.defaultDir", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "sortOptions.defaultOrder", "url": "YAHOO.widget.Column.html#property_sortOptions.defaultOrder", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "sortOptions.field", "url": "YAHOO.widget.Column.html#property_sortOptions.field", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "sortOptions.sortFunction", "url": "YAHOO.widget.Column.html#property_sortOptions.sortFunction", "type": "property"}, {"access": "", "host": "YAHOO.util.ColumnResizer", "name": "startDrag", "url": "YAHOO.util.ColumnResizer.html#method_startDrag", "type": "method"}, {"access": "", "host": "YAHOO.util.Chain", "name": "stop", "url": "YAHOO.util.Chain.html#method_stop", "type": "method"}, {"access": "private", "host": "YAHOO.widget.BaseCellEditor", "name": "_sType", "url": "YAHOO.widget.BaseCellEditor.html#property__sType", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "summary", "url": "YAHOO.widget.DataTable.html#config_summary", "type": "config"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "summaryChange", "url": "YAHOO.widget.DataTable.html#event_summaryChange", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "_syncColWidths", "url": "YAHOO.widget.DataTable.html#method__syncColWidths", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableBlurEvent", "url": "YAHOO.widget.DataTable.html#event_tableBlurEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableClickEvent", "url": "YAHOO.widget.DataTable.html#event_tableClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_tableDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableFocusEvent", "url": "YAHOO.widget.DataTable.html#event_tableFocusEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableKeyEvent", "url": "YAHOO.widget.DataTable.html#event_tableKeyEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_tableMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_tableMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_tableMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableMouseupEvent", "url": "YAHOO.widget.DataTable.html#event_tableMouseupEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableMsgHideEvent", "url": "YAHOO.widget.DataTable.html#event_tableMsgHideEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tableMsgShowEvent", "url": "YAHOO.widget.DataTable.html#event_tableMsgShowEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tbodyFocusEvent", "url": "YAHOO.widget.DataTable.html#event_tbodyFocusEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "tbodyKeyEvent", "url": "YAHOO.widget.DataTable.html#event_tbodyKeyEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.TextareaCellEditor", "name": "textarea", "url": "YAHOO.widget.TextareaCellEditor.html#property_textarea", "type": "property"}, {"access": "", "host": "YAHOO.widget.TextboxCellEditor", "name": "textbox", "url": "YAHOO.widget.TextboxCellEditor.html#property_textbox", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadCellClickEvent", "url": "YAHOO.widget.DataTable.html#event_theadCellClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadCellDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_theadCellDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadCellMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_theadCellMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadCellMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_theadCellMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadCellMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_theadCellMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadCellMouseupEvent", "url": "YAHOO.widget.DataTable.html#event_theadCellMouseupEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadFocusEvent", "url": "YAHOO.widget.DataTable.html#event_theadFocusEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadKeyEvent", "url": "YAHOO.widget.DataTable.html#event_theadKeyEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadLabelClickEvent", "url": "YAHOO.widget.DataTable.html#event_theadLabelClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadLabelDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_theadLabelDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadLabelMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_theadLabelMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadLabelMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_theadLabelMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadLabelMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_theadLabelMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadLabelMouseupEvent", "url": "YAHOO.widget.DataTable.html#event_theadLabelMouseupEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadRowClickEvent", "url": "YAHOO.widget.DataTable.html#event_theadRowClickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadRowDblclickEvent", "url": "YAHOO.widget.DataTable.html#event_theadRowDblclickEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadRowMousedownEvent", "url": "YAHOO.widget.DataTable.html#event_theadRowMousedownEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadRowMouseoutEvent", "url": "YAHOO.widget.DataTable.html#event_theadRowMouseoutEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadRowMouseoverEvent", "url": "YAHOO.widget.DataTable.html#event_theadRowMouseoverEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "theadRowMouseupEvent", "url": "YAHOO.widget.DataTable.html#event_theadRowMouseupEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "toString", "url": "YAHOO.widget.BaseCellEditor.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "toString", "url": "YAHOO.widget.ColumnSet.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.Column", "name": "toString", "url": "YAHOO.widget.Column.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "toString", "url": "YAHOO.widget.DataTable.html#method_toString", "type": "method"}, {"access": "", "host": "YAHOO.widget.ColumnSet", "name": "tree", "url": "YAHOO.widget.ColumnSet.html#property_tree", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "unblock", "url": "YAHOO.widget.BaseCellEditor.html#method_unblock", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "undisable", "url": "YAHOO.widget.DataTable.html#method_undisable", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "undisableEvent", "url": "YAHOO.widget.DataTable.html#event_undisableEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unhighlightCell", "url": "YAHOO.widget.DataTable.html#method_unhighlightCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unhighlightColumn", "url": "YAHOO.widget.DataTable.html#method_unhighlightColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unhighlightRow", "url": "YAHOO.widget.DataTable.html#method_unhighlightRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unselectAllCells", "url": "YAHOO.widget.DataTable.html#method_unselectAllCells", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unselectAllCellsEvent", "url": "YAHOO.widget.DataTable.html#event_unselectAllCellsEvent", "type": "event"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unselectAllRows", "url": "YAHOO.widget.DataTable.html#method_unselectAllRows", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unselectAllRowsEvent", "url": "YAHOO.widget.DataTable.html#event_unselectAllRowsEvent", "type": "event"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_unselectAllTdEls", "url": "YAHOO.widget.DataTable.html#method__unselectAllTdEls", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_unselectAllTrEls", "url": "YAHOO.widget.DataTable.html#method__unselectAllTrEls", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unselectCell", "url": "YAHOO.widget.DataTable.html#method_unselectCell", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unselectColumn", "url": "YAHOO.widget.DataTable.html#method_unselectColumn", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "unselectRow", "url": "YAHOO.widget.DataTable.html#method_unselectRow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_unsetFirstRow", "url": "YAHOO.widget.DataTable.html#method__unsetFirstRow", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_unsetLastRow", "url": "YAHOO.widget.DataTable.html#method__unsetLastRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "updateCell", "url": "YAHOO.widget.DataTable.html#method_updateCell", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_updatePaginator", "url": "YAHOO.widget.DataTable.html#method__updatePaginator", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "updateRow", "url": "YAHOO.widget.DataTable.html#method_updateRow", "type": "method"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "updateRows", "url": "YAHOO.widget.DataTable.html#method_updateRows", "type": "method"}, {"access": "private", "host": "YAHOO.widget.DataTable", "name": "_updateTrEl", "url": "YAHOO.widget.DataTable.html#method__updateTrEl", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "useIFrame", "url": "YAHOO.widget.BaseCellEditor.html#property_useIFrame", "type": "property"}, {"access": "", "host": "YAHOO.widget.DataTable", "name": "validateColumnWidths", "url": "YAHOO.widget.DataTable.html#method_validateColumnWidths", "type": "method"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "validator", "url": "YAHOO.widget.BaseCellEditor.html#property_validator", "type": "property"}, {"access": "", "host": "YAHOO.widget.BaseCellEditor", "name": "value", "url": "YAHOO.widget.BaseCellEditor.html#property_value", "type": "property"}, {"access": "", "host": "YAHOO.widget.CheckboxCellEditor", "name": "value", "url": "YAHOO.widget.CheckboxCellEditor.html#property_value", "type": "property"}, {"access": "", "host": "YAHOO.widget.Column", "name": "width", "url": "YAHOO.widget.Column.html#property_width", "type": "property"}];
</script>
</body>
</html>
